Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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)

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

Release History

Release History

This version
History Node

0.0.4

History Node

0.0.3

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
slackelot-0.0.4.tar.gz (4.2 kB) Copy SHA256 Checksum SHA256 Source Sep 5, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting