show when error occurred
This commit is contained in:
parent
f41db1dd67
commit
a046ba54a0
1 changed files with 6 additions and 2 deletions
4
bot.py
4
bot.py
|
@ -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:
|
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)
|
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))
|
await inter.edit_original_message(content=str(result))
|
||||||
|
|
||||||
bot.run(os.getenv("BOT_TOKEN"))
|
bot.run(os.getenv("BOT_TOKEN"))
|
Reference in a new issue