First pass of easy to produce errors#577
Conversation
Shivansh-007
left a comment
There was a problem hiding this comment.
Thanks! Looks Good To Me!
HassanAbouelela
left a comment
There was a problem hiding this comment.
One more thing: the issue command sitll errors out. I'll let you decide whether that's in scope or not.
| if not( | ||
| # Ignore messages from DMs | ||
| if not message.guild: | ||
| return |
There was a problem hiding this comment.
This should maybe send a message like riddle does? There's an argument there that it's a message, not a command, so it shouldn't error, but I don't know.
There was a problem hiding this comment.
No, this is a message argument, so we don't want to send messages on every message the user puts in the DMs.
There was a problem hiding this comment.
agreed, we don't want to send an error on every message in a DM, failing silently here is fine imo.
There was a problem hiding this comment.
If you move the regex up, you can get around this issue, and I think having an explicit “you can’t use issues in DM” is more useful than nothing. I can live without it.
Relevant Issues
Closes #576
Description
I've made sure that anywhere with an
on_messagelistener properly deals with messages from within DMs. This has been done by checking if message.guild is truethy, if so, its in a guild.i found these by searching for
on_messageand running .help in a DM to see if anything raised an error.Reasoning
This first pass just makes the bot ignore messages from DMs that were causing errors to be thrown.
Screenshots
For the riddle changes:

Additional Details
There are likely more cogs that raise errors when being ran through DMs, these changes were the easy to spot ones. I'm raising this PR to deal with these easy ones now, but intend to look into the other cogs further.
Did you:
pipenv lock?pipenv run lint)?