Better reaction-based quick actions#91
Merged
gwillen merged 6 commits intogwillen:masterfrom Jan 17, 2025
Merged
Conversation
gwillen
approved these changes
Jan 17, 2024
| 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: |
Owner
There was a problem hiding this comment.
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.)
Contributor
Author
There was a problem hiding this comment.
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) |
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
Author
|
Yes, it's fully tested and ready to go (now, I fixed a bug). |
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.
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)