From c1bffa219fa5fe4e31ece49d4b19f1ad0914282f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=95=98=EB=88=84?= Date: Wed, 22 Mar 2023 13:48:15 +0000 Subject: [PATCH] fix: Exception --- bot.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 1accf94..4b6ef57 100644 --- a/bot.py +++ b/bot.py @@ -55,9 +55,14 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction): await inter.edit_original_message(content="역할 데이터 등록을 시작합니다!") async with LinkedRolesOAuth2(client_id=os.getenv("CLIENT_ID"), token=os.getenv("BOT_TOKEN")) as client: - async for rec in async_list(list_chunk(records, 3)): - result = await client.register_role_metadata(records=tuple(rec), force=True) - await inter.followup.send(result) - await asyncio.sleep(5) + async for rec in async_list(list_chunk(records, 2)): + try: + result = await client.register_role_metadata(records=tuple(rec), force=True) + except Exception as e: + await inter.followup.send(e) + await asyncio.sleep(5) + else: + await inter.followup.send(result) + await asyncio.sleep(5) bot.run(os.getenv("BOT_TOKEN")) \ No newline at end of file