-
Notifications
You must be signed in to change notification settings - Fork 171
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
#359 Adds Slack bot message support to Slack backend #383
base: master
Are you sure you want to change the base?
Conversation
The old world weather API is no more. The replacement does not provide the local time in the JSON output. The solution is migrating the plugin to use the google apis which provides the timeZoneId, which is definitely enough for the `pytz` to generate a datetime object.
In the console the HTML tags look pretty uggly and it's better to eliminate them completely.
Fix worldtime plugin
…_backend strip HTML tags for shell backend
Feature/dockerized
* Tenzer-all-the-changes: Add Jeppe Toustrup to the AUTHORS list Bugfix: Avoid the use of `locals()` in the reminder plugin Bugfix: Don't report HC/BB state if the previous state wasn't known Pylint: W0612, W0613, remove unused variables Pylint: C1801, don't use `len(i) == 0` as a condition in if statements Pylint: W1201, let the logging functions do string interpolation Bugfix: Correct regex for will.plugins.friendly.mornin plugin Cleanup: Remove broken random_topic plugin Python 3: Run tests in Python 3 along with Python 2 Python 3: Use new way of representing octal numbers Python 3: Fix detection of plugin methods Python 3: Use new form of `except` lines Python 3: Make imports absolute and clean up unused ones Python 3: Use six to handle imports which have changed between 2 and 3 Python 3: Update dependencies on dnspython and natural to get PY3 support Python 3: print is a function, not a statement
…and spelling errors.
Feature/merges in py3
* feature/merges-in-py3: Friendlier location output
… of friendliness.
…cally handled (with explanations)
There was no check whether the given channel name, regular or default, existed. This caused the thread to fail and stall Will until it was restarted.
Fix fabfile with new Fabric v2
Support for slack attachments
Improve slack channel handling
skoczen#348 Scheduled reminders should notify the user who requested them
…ckends Add --backends option to generate_will_project
Improve Slack Connection handling
via self.get_bot in SlackBackend
@skoczen if you could please take a look at this - Without this PR, our bot is broken after moving to Slack, since it can't pick up any messages from our Jenkins or Rundeck integrations. |
This is a nice coincidence, I had just started taking a second look at my patch to see how to fix the issue you addressed! I'll patch this in and verify it. |
@Ashex Ah good timing then - thanks for the original patch! Hope this works for you as well. |
Added a commit that sets the event content to the first attachment's fallback field. Otherwise, content ends up equaling the original event object, which isn't what we want. I'm not sure there's a better way of extracting the message texts from bot_messages as they always seem to come as attachments with fields, AFAIK, and there can be zero or more. /cc @Ashex |
PR adds support for Slack bot messages that come in via WebHooks. Based on the work from @Ashex in the original issue, it updates the message type check, and creates a Sender object from the bot details.
Additionally adds a new method in the SlackBackend,
get_bot(self, bot_id)
that queries the info for the specified bot from Slack. It then creates a new dict object containing the bot information, and stores it underself._bots
. If we already have the bot stored, we return the stored object.Slack does not have a "get all bot info" API call, so, we must get them one at a time like this, unfortunately. The event object received does not contain the bot name, only an ID, hence the inclusion of the above method to get the info.
Tested locally, the PR allows me to receive messages from our Jenkins app integration.
EDIT: PR also sets version of pytest-cov to 2.5.1, as 2.6.0 (The newest version as of 7 days ago) requires an upgrade to pytest 2.9
Fixes #359