Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions redbot/core/core_commands.py
Expand Up @@ -3598,13 +3598,11 @@ async def _set_api(
- `<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 `;`.
"""
if service is None: # Handled in order of missing operations
await ctx.send(_("Click the button below to set your keys."), view=SetApiView())
elif tokens is None:
await ctx.send(
_("Click the button below to set your keys."),
view=SetApiView(default_service=service),
)
if service is None or tokens is None:
view = SetApiView(default_service=service)
msg = await ctx.send(_("Click the button below to set your keys."), view=view)
await view.wait()
await msg.edit(content=_("This API keys setup message has expired."), view=None)
else:
if ctx.bot_permissions.manage_messages:
await ctx.message.delete()
Expand Down