Fix DM handling for code snippets.#2086
Merged
Merged
Conversation
ToxicKidz
suggested changes
Feb 17, 2022
Contributor
ToxicKidz
left a comment
There was a problem hiding this comment.
There's one line that causes an error, but other than that this looks good.
ToxicKidz
reviewed
Feb 17, 2022
- Changed `destination.guild` to `message.guild` since `DMChannel` doesn't have a "guild" attribute - Only call `wait_for_deletion` when inside a guild.
Bluenix2
approved these changes
Feb 28, 2022
Contributor
Bluenix2
left a comment
There was a problem hiding this comment.
I do have one comment you can implement if there comes other feedback, it's not a big deal overall. I can't manage to trigger the codepath that sends the ouput to bot-commands, but this fixes the issue listed.
Thank you for this Tizzy!
9510669 to
880d42a
Compare
ChrisLovering
approved these changes
Mar 4, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2081.
Catches error raised when trying to edit message in DM fails (we still try to edit so we can ensure the message hasn't been deleted).
If the error was raised by a message inside the guild, then we reraise the error since that's unexpected behaviour (would mean that the bot has missing permissions).
Also only checks if we need to send to #bot-commands when the message was sent in the guild.
NB: Currently untested.