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

support bot messages with message attachment fallback #152

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

Conversation

guruofquality
Copy link

Just wanted to share my latest patch for supporting bot messages. Related conversation for reference. I have been using this with github and twitter integration in slack.

Here is the breakdown:

  • Expanded ALLOWED_SUBTYPES to include 'bot_message'
  • parseText() handles undefined input because some messages don't have the text field set (twitter)
  • Support bot_messages with attachments that have "fallback" messages. Fallback messages are short text only messages provided by the slack integration app for printing in text-only situations.
  • Minor formatting for fallback messages to make <URL|desc> markup click-able by replacing "|". And also adding IRC coloring escape code because color is nice.
  • Ignore bot_messages without attachments. This prevents echos from the slack-irc bot itself. This would also exclude slack integrations that dont use fallback. At least this isnt an issue so far, and these bot messages are already ignored anyway.

So theres no additional config to support this. The change basically just means that bot messages are still ignored, except when they contain an attachment with a fallback message. So I hope that this is mostly an additive change without any negative side-effects. Thanks for your consideration!

@jywarren
Copy link

Hi, any updates on this PR or what it'd take to get it adopted? Thanks so much!

@guruofquality
Copy link
Author

I couldn’t figure out how to get the checks to pass, because the traversal checks through the code is different (obviously) with the changes. But the changes themselves have been working for my personal uses this whole time FWIW.

@csoni111
Copy link

Hi I am new user of slack-irc and would really like this feature to be merged.
@guruofquality The checks were failing because of this test. You may change the subtype in that message to something other than bot_message since now that is allowed. Also you will need to resolve the conflicting files.

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.

3 participants