Skip to content

Fix exception when checking owner status and guild is not present #79

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

Closed

Conversation

apdastous
Copy link

@apdastous apdastous commented Jan 21, 2023

Just found this repo recently, love it!

I've been testing my bot and ran into an issue where owner only commands were failing in DMs. I used the testcommand and get this traceback due to context.guild not containing expected attributes. PR is a simple fix for this issue.

  File "/home/apd/projects/mrvn-apexlegends-discord-bot/venv/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "/home/apd/projects/mrvn-apexlegends-discord-bot/bot.py", line 239, in on_command_error
    f"{context.author} (ID: {context.author.id}) tried to execute an owner only command in the guild {context.guild.name} (ID: {context.guild.id}), but the user is not an owner of the bot.")
AttributeError: 'NoneType' object has no attribute 'name'

@kkrypt0nn
Copy link
Owner

Hey there!

Thanks for noting that out and for wanting to fix it, though you are not following the Contributing Guidelines.

Please follow these guidelines and update your contribution accordingly, thanks in advance.

@kkrypt0nn kkrypt0nn closed this Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants