Update timing_task.py

This commit is contained in:
HibiKier 2021-07-30 22:28:13 +08:00 committed by GitHub
parent 1b99c34cfb
commit 825671447a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,11 +28,14 @@ async def _():
minutes=5, minutes=5,
) )
async def _(): async def _():
bot = get_bot() try:
gl = await bot.get_group_list(self_id=bot.self_id) bot = get_bot()
gl = [g["group_id"] for g in gl] gl = await bot.get_group_list(self_id=bot.self_id)
all_group = [x.group_id for x in await GroupInfo.get_all_group()] gl = [g["group_id"] for g in gl]
for g in gl: all_group = [x.group_id for x in await GroupInfo.get_all_group()]
if g not in all_group: for g in gl:
await update_member_info(g) if g not in all_group:
logger.info(f"快速更新群信息以及权限:{g}") await update_member_info(g)
logger.info(f"快速更新群信息以及权限:{g}")
except IndexError:
pass