先修一下命令无法正常检查聊天类型限制
This commit is contained in:
committed by
Windpicker-owo
parent
c9b20aa61a
commit
b98417dec6
2388
app_20250923_001038.log.jsonl
Normal file
2388
app_20250923_001038.log.jsonl
Normal file
File diff suppressed because one or more lines are too long
@@ -265,7 +265,7 @@ class ChatBot:
|
|||||||
try:
|
try:
|
||||||
# 检查聊天类型限制
|
# 检查聊天类型限制
|
||||||
if not command_instance.is_chat_type_allowed():
|
if not command_instance.is_chat_type_allowed():
|
||||||
is_group = hasattr(message, "is_group_message") and message.is_group_message
|
is_group = message.message_info.group_info
|
||||||
logger.info(
|
logger.info(
|
||||||
f"命令 {command_class.__name__} 不支持当前聊天类型: {'群聊' if is_group else '私聊'}"
|
f"命令 {command_class.__name__} 不支持当前聊天类型: {'群聊' if is_group else '私聊'}"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class BaseCommand(ABC):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# 检查是否为群聊消息
|
# 检查是否为群聊消息
|
||||||
is_group = hasattr(self.message, "is_group_message") and self.message.is_group_message
|
is_group = self.message.message_info.group_info
|
||||||
|
|
||||||
if self.chat_type_allow == ChatType.GROUP and is_group:
|
if self.chat_type_allow == ChatType.GROUP and is_group:
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user