0
0
Fork 0

show when error occurred

This commit is contained in:
하누 2023-03-22 13:04:57 +00:00 committed by GitHub
parent f41db1dd67
commit a046ba54a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
bot.py
View file

@ -51,7 +51,11 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction):
))
async with LinkedRolesOAuth2(client_id=os.getenv("CLIENT_ID"), token=os.getenv("BOT_TOKEN")) as client:
try:
result = await client.register_role_metadata(records=tuple(records), force=True)
except Exception as e:
await inter.edit_original_message(content=f"연동에 실패했습니다.\n{e}")
else:
await inter.edit_original_message(content=str(result))
bot.run(os.getenv("BOT_TOKEN"))