Update __init__.py

This commit is contained in:
AkashiCoin 2021-10-03 20:17:08 +08:00 committed by GitHub
parent 65723aee15
commit ba29232c9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,7 @@ __plugin_settings__ = {
"limit_superuser": False, "limit_superuser": False,
"cmd": ["epic"], "cmd": ["epic"],
} }
__plugin_task__ = { __plugin_task__ = {"epic_free_game": "epic免费游戏"}
'epic_free_game': 'epic免费游戏'
}
epic = on_command("epic", priority=5, block=True) epic = on_command("epic", priority=5, block=True)
@ -35,7 +33,7 @@ async def handle(bot: Bot, event: Event, state: T_State):
msg_list = [] msg_list = []
msg_list, code = await get_Epicfree(bot, event) msg_list, code = await get_Epicfree(bot, event)
if code == 404: if code == 404:
epic.finish(msg_list) await epic.send(msg_list)
elif isinstance(event, GroupMessageEvent): elif isinstance(event, GroupMessageEvent):
await bot.send_group_forward_msg(group_id=event.group_id, messages=msg_list) await bot.send_group_forward_msg(group_id=event.group_id, messages=msg_list)
else: else:
@ -58,13 +56,13 @@ async def _():
gl = await bot.get_group_list() gl = await bot.get_group_list()
gl = [g["group_id"] for g in gl] gl = [g["group_id"] for g in gl]
for g in gl: for g in gl:
if await group_manager.check_group_task_status(g, 'epic_free_game'): if await group_manager.check_group_task_status(g, "epic_free_game"):
try: try:
msg_list = [] msg_list = []
msg_list, code = await get_Epicfree_Group(bot, event) msg_list, code = await get_Epicfree(bot, GroupMessageEvent)
if code == 200: if code == 200:
await bot.send_group_forward_msg(group_id=event.group_id, messages=msg_list) await bot.send_group_forward_msg(group_id=g, messages=msg_list)
else: else:
epic.finish(msg_list) await bot.send_group_msg(group_id=g, maessage=msg_list)
except Exception as e: except Exception as e:
logger.error(f"GROUP {g} epic免费游戏推送错误 {type(e)}: {e}") logger.error(f"GROUP {g} epic免费游戏推送错误 {type(e)}: {e}")