fix: maybe this can fix issue?
This commit is contained in:
parent
b33cfd4355
commit
f41db1dd67
1 changed files with 4 additions and 3 deletions
3
bot.py
3
bot.py
|
@ -22,7 +22,6 @@ async def async_list(values: list) -> Any:
|
||||||
@commands.is_owner()
|
@commands.is_owner()
|
||||||
async def _addConnection(inter: disnake.ApplicationCommandInteraction):
|
async def _addConnection(inter: disnake.ApplicationCommandInteraction):
|
||||||
await inter.response.defer(ephemeral=True)
|
await inter.response.defer(ephemeral=True)
|
||||||
client = LinkedRolesOAuth2(client_id=os.getenv("CLIENT_ID"), token=os.getenv("BOT_TOKEN"))
|
|
||||||
records = [
|
records = [
|
||||||
RoleMetadataRecord(
|
RoleMetadataRecord(
|
||||||
key="complete",
|
key="complete",
|
||||||
|
@ -50,6 +49,8 @@ async def _addConnection(inter: disnake.ApplicationCommandInteraction):
|
||||||
description=achievement["description"],
|
description=achievement["description"],
|
||||||
type=RoleMetadataType.boolean_equal
|
type=RoleMetadataType.boolean_equal
|
||||||
))
|
))
|
||||||
|
|
||||||
|
async with LinkedRolesOAuth2(client_id=os.getenv("CLIENT_ID"), token=os.getenv("BOT_TOKEN")) as client:
|
||||||
result = await client.register_role_metadata(records=tuple(records), force=True)
|
result = await client.register_role_metadata(records=tuple(records), force=True)
|
||||||
await inter.edit_original_message(content=str(result))
|
await inter.edit_original_message(content=str(result))
|
||||||
|
|
||||||
|
|
Reference in a new issue