-
Notifications
You must be signed in to change notification settings - Fork 4
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
Better reaction-based quick actions #91
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_channel = message.channel_mentions[0] | ||
await self.add_user_to_puzzle(payload.member, target_channel.name) | ||
# we're ok with this working anywhere for any reason if anyone ever mentions a puzzle channel | ||
if len(message.raw_channel_mentions) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does raw_channel_mentions
in fact work for what we need here, for both regular and DM messages? (I saw in ryan's PR that regular channel_mentions
did not.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does. All channel_mentions
does is map message.guild.get_channel
over raw_channel_mentions
, but if message
is a DM, that doesn't work because it doesn't have a guild. So I'm doing it myself.
herring/puzzles/tasks.py
Outdated
def post_local_and_global(local_channel, local_message, global_message): | ||
logging.warning("tasks: post_local_and_global(%s, %s, %s)", local_channel, local_message, global_message) | ||
def post_local_and_global(local_channel, local_message, global_message, local_reaction=None, global_reaction=None): | ||
logging.warning("tasks: post_local_and_global(%s, %s, %s, %s)", local_channel, local_message, global_message, local_reaction, global_reaction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed a %s
there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blast, I originally only included one reaction and added the 2nd one later when I realized that I was sometimes going to want it in global but not local. Will fix.
Yes, it's fully tested and ready to go (now, I fixed a bug). |
High-five now works almost anywhere a puzzle channel is mentioned
Add "leaves" reaction to puzzle solved messages to leave the puzzle (fixes #66)
Messages in puzzle-announcements now include the round name (fixes #87)