Clear the view in [p]set api after timeout (#6166)

This commit is contained in:
AAA3A 2023-06-20 13:09:01 +02:00 committed by GitHub
parent 4dc7efab29
commit b1c3b37235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3602,13 +3602,11 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
- `<service>` - The service you're adding tokens to. - `<service>` - The service you're adding tokens to.
- `<tokens>` - Pairs of token keys and values. The key and value should be separated by one of ` `, `,`, or `;`. - `<tokens>` - Pairs of token keys and values. The key and value should be separated by one of ` `, `,`, or `;`.
""" """
if service is None: # Handled in order of missing operations if service is None or tokens is None:
await ctx.send(_("Click the button below to set your keys."), view=SetApiView()) view = SetApiView(default_service=service)
elif tokens is None: msg = await ctx.send(_("Click the button below to set your keys."), view=view)
await ctx.send( await view.wait()
_("Click the button below to set your keys."), await msg.edit(content=_("This API keys setup message has expired."), view=None)
view=SetApiView(default_service=service),
)
else: else:
if ctx.bot_permissions.manage_messages: if ctx.bot_permissions.manage_messages:
await ctx.message.delete() await ctx.message.delete()