[INTPROD-9204] Allow Match By Bot User ID #106
Merged
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.
This pull request includes changes to the
omnibot
service and its documentation. The changes mainly revolve around the addition of auser_id
property in theBot
class, the modification of the_parse_payload
method in theMessage
class to include a check for the bot'suser_id
, and the addition of important notes in theAdding normal slack apps
documentation.Documentation Updates:
docs/root/adding_new_slack_apps.rst
: Added notes about the potential for the bot to be called twice ifapp_mention
is added, the need forbot.name
to match the appuser_handle
, and the need to specifymatch_mention: true
ifuser_handle
andbot.name
do not match.Codebase Updates:
omnibot/services/slack/bot.py
: Importedget_auth
fromomnibot.services.slack
and added auser_id
property to theBot
class that fetches theuser_id
frombot_data
or callsget_auth
ifuser_id
is not present. [1] [2]omnibot/services/slack/message.py
: Modified the_parse_payload
method to check if the bot'suser_id
is mentioned in the message.tests/unit/omnibot/services/slack/message_test.py
: Updated the test setup to include auser_id
in the bot's data.