You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As an exercise, this issue is to take the functionality of Reacji Channeler and port that to Bubbles.
Overview
This will require the following components:
one command to add, delete, or list emoji / channel associations
the actual listener to perform the copying when a known emoji is applied
Example commands:
I'm calling it channeler here but that's up for debate.
@bubbles channeler :thonking: #general
@bubbles channeler delete :thonking:
@bubbles channeler list
Notes
The list of associations will have to survive reboots and deploys without being lost, so the best way to do that is some form of local file. A database (even sqlite) is overkill, so a JSON file will do.
Warning: paths change their behavior after Bubbles is compiled into an archive. Import ARCHIVE_PATH from bubbles.config and check its value; if it's None, you're running in development mode and paths will work as expected. If it's anything else, use that path as the base for where to put and read your file.
Of course, this project wouldn't be a Slack-based project unless there was some Slack-related BS to deal with. When the payload comes in, it doesn't actually give you any useful information about the message that was reacted to, which is pretty important for this functionality. To combat this, I've added a new function -- payload.get_reaction_message(), which reaches out to Slack and asks nicely for this data. You can see the format of the returned payload here:
I think all you need to do is grab the permalink attribute out of the returned data and send that with unfurl_links=True to the given channel, but we'll see how far we can go before deploying to test.
If you run into any issues, reach out to Joe or Tim on #dev_general. Don't struggle with any single problem for more than 30 minutes to an hour before asking for help! (Reminder that interactive mode exists for local testing -- trigger it with python blossom/main.py --interactive.)
The text was updated successfully, but these errors were encountered:
As an exercise, this issue is to take the functionality of Reacji Channeler and port that to Bubbles.
Overview
This will require the following components:
Example commands:
I'm calling it
channeler
here but that's up for debate.@bubbles channeler :thonking: #general
@bubbles channeler delete :thonking:
@bubbles channeler list
Notes
The list of associations will have to survive reboots and deploys without being lost, so the best way to do that is some form of local file. A database (even sqlite) is overkill, so a JSON file will do.
Example schema:
The actual receipt of the reaction emoji is already handled for you and provided in Payload form. Put your logic in its own function in https://github.com/GrafeasGroup/Bubbles/blob/master/bubbles/reaction_added.py; call it from
reaction_added_callback
and just pass the payload along.Of course, this project wouldn't be a Slack-based project unless there was some Slack-related BS to deal with. When the payload comes in, it doesn't actually give you any useful information about the message that was reacted to, which is pretty important for this functionality. To combat this, I've added a new function --
payload.get_reaction_message()
, which reaches out to Slack and asks nicely for this data. You can see the format of the returned payload here:Bubbles/bubbles/message_utils.py
Lines 108 to 128 in ce643cc
I think all you need to do is grab the
permalink
attribute out of the returned data and send that withunfurl_links=True
to the given channel, but we'll see how far we can go before deploying to test.If you run into any issues, reach out to Joe or Tim on #dev_general. Don't struggle with any single problem for more than 30 minutes to an hour before asking for help! (Reminder that interactive mode exists for local testing -- trigger it with
python blossom/main.py --interactive
.)The text was updated successfully, but these errors were encountered: