From 73cb17ab538fc529bad8a40462d581afdce7c1c5 Mon Sep 17 00:00:00 2001 From: Kyomotoi <37587870+Kyomotoi@users.noreply.github.com> Date: Tue, 14 Jul 2020 12:55:51 +0800 Subject: Update send.py --- AyaBot/plugins/send.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'AyaBot/plugins') diff --git a/AyaBot/plugins/send.py b/AyaBot/plugins/send.py index 6efc115..bf9b91e 100644 --- a/AyaBot/plugins/send.py +++ b/AyaBot/plugins/send.py @@ -43,11 +43,22 @@ async def send_to_group(session: CommandSession): group = lg[0] msg = lg[1] + rei = lg[2] + + if rei: + for i in range(1, int(rei)): + try: + await bot.send_group_msg(group_id = group, message = msg) + except: + await session.send('发送失败,请重试') + + else: + await session.send('吾辈推送...完成!') - try: - await bot.send_group_msg(group_id = group, message = msg) - except: - await session.send('发送失败,请重试') + try: + await bot.send_group_msg(group_id = group, message = msg) + except: + await session.send('发送失败,请重试') await session.send('吾辈推送...完成!') -- cgit v1.2.3