Simple internal Slack API wrapper
Project description
ritdu-slacker
pip installable bin to interact with the Ringier SA internal interface for slack. Provides both CLI and Native Lib functionality.
Motivation
- Single implementation of a wrapper around our internal slack interface.
Installation
$ pip install ritdu-slacker
CLI Usage
To send a message to a slack channel from within a thread:
$ ritdu-slacker message --workspace "${SLACK_WORKSPACE}" --channel "${SLACK_CHANNEL//#}" --text "Update in progress" --thread-uuid "${thread_uuid}" --thread-broadcast
To replace a message send a new one with the same message-uuid:
$ ritdu-slacker message --workspace "${SLACK_WORKSPACE}" --channel "${SLACK_CHANNEL//#}" --text "Update complete!" --message-uuid "${message_uuid}"
To send a message and file to a thread in a slack channel:
$ ritdu-slacker file --workspace "${SLACK_WORKSPACE}" --channel "${SLACK_CHANNEL//#}" --text "Oops!" --file "/tmp/errorlog.txt" --thread-uuid "${thread_uuid}"
Native library Usage
from ritdu_slacker.api import SlackClient
client = SlackClient()
client.post_message("via python api","ringier-southafrica","#pe-alerts")
{'message_uuid': '9890b802-fac3-4e61-bbe8-b53cc17fc581', 'message_ts': '1677473299.255969', 'thread_uuid': '9890b802-fac3-4e61-bbe8-b53cc17fc581', 'thread_ts': '1677473299.255969', 'channel': 'CV3JFH08J'}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ritdu-slacker-1.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for ritdu_slacker-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16f3e178c064c0b9e67b4ae247385de35c9c0e31cf2b7d475d7b9a78c6d30553 |
|
MD5 | f95198dd7fc69e5798f5db46c91ae769 |
|
BLAKE2b-256 | 155f557b7066043e36a33123dabe811581e315d41ef60f51d1f3ae2902aae8e3 |