Skip to content

Commit

Permalink
Update timing_task.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier committed Jul 30, 2021
1 parent 1b99c34 commit 8256714
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions plugins/admin_bot_manage/timing_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ async def _():
minutes=5,
)
async def _():
bot = get_bot()
gl = await bot.get_group_list(self_id=bot.self_id)
gl = [g["group_id"] for g in gl]
all_group = [x.group_id for x in await GroupInfo.get_all_group()]
for g in gl:
if g not in all_group:
await update_member_info(g)
logger.info(f"快速更新群信息以及权限:{g}")
try:
bot = get_bot()
gl = await bot.get_group_list(self_id=bot.self_id)
gl = [g["group_id"] for g in gl]
all_group = [x.group_id for x in await GroupInfo.get_all_group()]
for g in gl:
if g not in all_group:
await update_member_info(g)
logger.info(f"快速更新群信息以及权限:{g}")
except IndexError:
pass

0 comments on commit 8256714

Please sign in to comment.