Skip to content

Pin initial puzzle channel messages to Discord Channel#862

Open
calvinballing wants to merge 1 commit into
cardinalitypuzzles:mainfrom
calvinballing:pin-top-discord-messages
Open

Pin initial puzzle channel messages to Discord Channel#862
calvinballing wants to merge 1 commit into
cardinalitypuzzles:mainfrom
calvinballing:pin-top-discord-messages

Conversation

@calvinballing
Copy link
Copy Markdown
Contributor

This pins the two Discord messages with links (General Links, and Google Sheets Link) to the top of each Discord puzzle channel. It might also be nice to pin some later messages such as when a puzzle is solved, however if a puzzle becomes unsolved that message should get unpinned, which is a little more complicated, so I skipped that for now

@calvinballing calvinballing force-pushed the pin-top-discord-messages branch 2 times, most recently from ef1a66e to 292ba79 Compare January 17, 2025 14:21
Copy link
Copy Markdown
Collaborator

@npinsker npinsker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the changes! as a heads up -- as you can imagine, we're not gonna actively merge backend PRs during Mystery Hunt, but happy to continue reviewing and can get it in afterwards

return [{"fields": fields, "color": 12852794, "type": "rich"}]

def send_message(self, channel_id, msg, embedded_urls={}):
def send_message(self, channel_id, msg, embedded_urls={}, pin=False):
Copy link
Copy Markdown
Collaborator

@npinsker npinsker Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • remember to match the ChatService contract to your changes

  • i don't love adding that parameter to send_message, ideally we should keep it separate from the ability to pin. instead, we should independently add the ability to pin a message to ChatService, and expose some way to get the id of the message, e.g. by just returning it from send_message

Copy link
Copy Markdown
Contributor Author

@calvinballing calvinballing Jan 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your proposal would definitely be a better construction. This was more of a quick and dirty way to get it working. I may look at refactoring this after hunt. I forgot before pushing that I hadn't bothered with the tests when getting it running

@calvinballing calvinballing force-pushed the pin-top-discord-messages branch from 292ba79 to 3a2e289 Compare January 17, 2025 14:44
@calvinballing
Copy link
Copy Markdown
Contributor Author

thanks for the changes! as a heads up -- as you can imagine, we're not gonna actively merge backend PRs during Mystery Hunt, but happy to continue reviewing and can get it in afterwards

We've been using this during our practice hunt successfully, but yeah, I wouldn't expect you to pull in untested code last minute :)

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