This commit is contained in:
jxxghp 2023-07-14 15:40:19 +08:00
parent 0b1f17eb02
commit a81c9262c3
3 changed files with 9 additions and 6 deletions

View File

@ -65,7 +65,8 @@ class MessageChain(ChainBase):
EventType.CommandExcute,
{
"cmd": text,
"user": userid
"user": userid,
"channel": channel
}
)
@ -230,7 +231,7 @@ class MessageChain(ChainBase):
else:
# 发送媒体数据
self.__post_medias_message(channel=channel,
title=self._current_media.title,
title=self._current_meta.name,
items=cache_list[start:end],
userid=userid,
total=len(cache_list))
@ -263,7 +264,7 @@ class MessageChain(ChainBase):
else:
# 发送媒体数据
self.__post_medias_message(channel=channel,
title=self._current_media.title,
title=self._current_meta.name,
items=cache_list, userid=userid, total=total)
else:

View File

@ -191,7 +191,7 @@ class Command(metaclass=Singleton):
elif args_num == 2:
# 没有输入参数只输入渠道和用户ID
command['func'](channel, userid)
else:
elif args_num > 2:
# 多个输入参数用户输入、用户ID
command['func'](data_str, channel, userid)
else:
@ -219,10 +219,12 @@ class Command(metaclass=Singleton):
"""
# 命令参数
event_str = event.event_data.get('cmd')
# 消息渠道
event_channel = event.event_data.get('channel')
# 消息用户
event_user = event.event_data.get('user')
if event_str:
cmd = event_str.split()[0]
args = " ".join(event_str.split()[1:])
if self.get(cmd):
self.execute(cmd, args, event_user)
self.execute(cmd, args, event_channel, event_user)

View File

@ -87,7 +87,7 @@ class TelegramModule(_ModuleBase):
self.telegram.send_msg(title="你不在用户白名单中,无法使用此机器人", userid=user_id)
return CommingMessage(channel=MessageChannel.Wechat,
userid=user_id, username=user_id, text="")
return CommingMessage(channel=MessageChannel.Wechat,
return CommingMessage(channel=MessageChannel.Telegram,
userid=user_id, username=user_id, text=text)
return None