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

Send message to Discord with a webhook upon dweet creation #418

Merged
merged 4 commits into from
Oct 26, 2018
Merged

Conversation

lionleaf
Copy link
Owner

Register a signal that triggers on new dweets that sends a POST request
to the configured DISCORD_WEBHOOK (from settings/local.py) that posts a
message to Discord.

This commit also sets up the signals.py file and imports it with the
recommended path (apps.py).

  • Run make lint to ensure that all the files are formatted and using best practices.
  • Link to any issues this PR is solving.

fixes #370

Register a signal that triggers on new dweets that sends a POST request
to the configured DISCORD_WEBHOOK (from settings/local.py) that posts a
message to Discord.

This commit also sets up the signals.py file and imports it with the
recommended path (apps.py).
@lionleaf lionleaf force-pushed the webhooks branch 2 times, most recently from 59a7c8a to 6297a32 Compare October 25, 2018 08:27
For some reasons reverse() is failing in the @signal on Jenkins when
testing, but not while running tests locally. Seems like the signal is
called before urls.py is loaded somehow, but I don't understand why that
would be different locally.

As the urls were partially hardcoded anyway, reverse() isn't providing a
lot of value, and this text is likely to get changed later, I'm just
hardcoding the full url
urllib2 is python2 only. And the default python3 equivalent doesn't work
in python2. So had to install future to bridge the gap
Simpler and with python2 and 3 support
@lionleaf lionleaf merged commit df11c9f into master Oct 26, 2018
@lionleaf lionleaf deleted the webhooks branch October 26, 2018 07:07
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.

Webhooks
1 participant