diff options
author | Kyomotoi <[email protected]> | 2020-08-11 09:05:23 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-08-11 09:05:23 +0800 |
commit | affbb5f423c1e345ead9d85e9283dd90496265af (patch) | |
tree | 4a20e41d898a3e7930af9dc468e4018a78f39df0 /ATRI/plugins/other.py | |
parent | 593c9afe1a80a299248b4fa152d9920a7a99cefa (diff) | |
download | ATRI-affbb5f423c1e345ead9d85e9283dd90496265af.tar.gz ATRI-affbb5f423c1e345ead9d85e9283dd90496265af.tar.bz2 ATRI-affbb5f423c1e345ead9d85e9283dd90496265af.zip |
[Fix]
Diffstat (limited to 'ATRI/plugins/other.py')
-rw-r--r-- | ATRI/plugins/other.py | 73 |
1 files changed, 21 insertions, 52 deletions
diff --git a/ATRI/plugins/other.py b/ATRI/plugins/other.py index 457381d..d1a105c 100644 --- a/ATRI/plugins/other.py +++ b/ATRI/plugins/other.py @@ -57,14 +57,7 @@ MENU_AND = ''' '''.strip() -# 论如何将 Python 写出 Java 的味道 -# 接下来给各位展示一下 -# 咱的屎山 - -@on_command( - '抽签', - only_to_me = False -) +@on_command('抽签', only_to_me = False) async def _(session: CommandSession): await session.send( str( @@ -85,14 +78,7 @@ async def _(session: CommandSession): ) ) -@on_command( - '掷骰子', - aliases = [ - '扔骰子', - '骰子' - ], - only_to_me = False -) +@on_command('掷骰子', aliases = ['扔骰子', '骰子'], only_to_me = False) async def _(session: CommandSession): await session.send( str( @@ -102,66 +88,49 @@ async def _(session: CommandSession): ) ) -@on_command( - '关于', - aliases = [ - '关于机器人' - ], - only_to_me = False -) +@on_command('关于', aliases = ['关于机器人'], only_to_me = False) async def _(session: CommandSession): await session.send( - f"""想了解ATRI嘛 + """想了解ATRI嘛 写出咱的是Kyomotoi 他的主页:https://blog.lolihub.icu/ 项目地址:https://github.com/Kyomotoi/ATRI 欢迎star~w!""" ) -@on_command( - 'help', - aliases = [ - '帮助', - '如何使用ATRI', - '机器人帮助' - ], - only_to_me = False -) +@on_command('help', aliases = ['帮助', '如何使用ATRI', '机器人帮助'], only_to_me = False) async def _(session: CommandSession): await session.send( f"""{render_expression(HELP_REPLY)} 发送:菜单 或看这吧! https://blog.lolihub.icu/#/ATRI/user""" - ) + ) -@on_command( - 'menu', - aliases = [ - '菜单' - ], - only_to_me = False -) +@on_command('menu', aliases = ['菜单'], only_to_me = False) async def _(session: CommandSession): await session.send(MENU_REPO) time.sleep(0.5) await session.send(MENU_AND) -@on_command( - 'report', - aliases = [ - '来杯红茶' - ], - only_to_me = True -) +@on_command('report', aliases = ['来杯红茶'], only_to_me = True) async def _(session: CommandSession): + h_type = session.event.detail_type msg = session.current_arg.strip() user = session.event.user_id group = session.event.group_id + if not msg: msg = session.get('message', prompt='请键入需要反馈的信息') + + if h_type == 'group': + await bot.send_private_msg( + user_id = master, + message = f"来自群[{group}],用户[{user}]的反馈:\n{msg}" + ) # type: ignore - await bot.send_private_msg( - user_id = master, - message = f"来自群[{group}],用户[{user}]的反馈:\n{msg}" - ) # type: ignore
\ No newline at end of file + elif h_type == 'private': + await bot.send_private_msg( + user_id = master, + message = f"来自用户[{user}]的反馈:\n{msg}" + ) # type: ignore
\ No newline at end of file |