Skip to main content

A simple wrapper around the Slack web api to post messages

Project description

Simple wrapper around the Slack Web API to post messages.

Details

Slackelot contains a single function:
send_message(message, webhook_url, pretext='', title='', author_name='', color=None)

webhook_url should be in the following format: 'https://hooks.slack.com/services/TEAM_ID/BOT_OR_CHANNEL_ID/AUTH_TOKEN'

Example

from slackelot import send_message


webhook_url = 'https://hooks.slack.com/services/TXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX'
message = 'Who wants to push the pram?\n@lancelot @percival'
pretext = 'Knights of the Round Table'
title = 'Spamelot'
author_name = 'Arthur'
color = '#663399'

send_message(message, webhook_url, pretext=pretext, title=title, author_name=author_name, color=color)
https://github.com/Chris-Graffagnino/slackelot/blob/master/slackelot\_example.png

https://github.com/Chris-Graffagnino/slackelot/blob/master/slackelot_example.png

Extra Goodness

Paid teams have the option to mention other subteams, (ie. channel). In that case, you might append something like this to your message:

'\n<!subteam^ID|HANDLE>' (replace ID and HANDLE with your subteam’s id and name, respectively).

For more information on message formatting, see the Slack API docs

FAQ

Where do I find my Slack team id?

Where do I find my Slack channel ids?

How do I create the url (webhook)?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slackelot-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file slackelot-0.0.4.tar.gz.

File metadata

  • Download URL: slackelot-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for slackelot-0.0.4.tar.gz
Algorithm Hash digest
SHA256 e53da06a9b64aa56b3fc3fb1f286bf16fd0c5b8cdf6c3e4ded4fdb4764f1de42
MD5 cda6396197ffcfe842894ea4c6530b8e
BLAKE2b-256 3d8712e51b25b1cb37825dd52b85bb7560f09b67f898a89af43e9eadeb99054d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page