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

Dm safe #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

patchwork-systems
Copy link

This PR separates the ReactionAddReply class in a way that provides 2 classes, one with the full previous functionality and one that is safe to use in Direct Messages with more limited permissions!

Asterisk* added 3 commits July 7, 2021 23:04
Documentation states that Reply super classes should be able to accept a Callable and the Callable will recieve the reply object.

Currently the Callable does not recieve the reply object.
Because ReactionAddReply uses message.remove_reaction() and message.clear_reactions(), they cannot be used in direct messages.

This PR separates ReactionAddReply into two classes

DirectMessageReactionAddReply(ReactionAddBasic) which takes on_reply_init and reply_check
ReactionAddReply(DirectMessageReactionAddReply) which adds on_reply_attempt and on_reply_complete

----

Having a class that works by default with DM's seems like a fairly common use case.
@cysabi
Copy link
Owner

cysabi commented Jul 10, 2021

This is helpful!

May I suggest, instead of separating a DM safe variant into it's own class, adding try/except or if statements?

For example:

if isinstance(self.ctx.channel, discord.DMChannel):

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