Slack Messanger Client using Incoming Webhooks
Project description
slack-messenger
Description
The slack-messenger is a simple package that helps send Slack Messages via Incoming Webhook URLs. For more information on how to create a Slack App, and how to generate an incoming webhook URL please read the official Slack documentation on sending messages using Incoming Webhooks.
How to use slack-messenger
from slack-messenger import SlackMessenger
# Create the SlackMessenger object with your Incoming Webhook URL
url = "https://hooks.slack.com/services/<rest-of-the-webhook>"
sm = SlackMessenger(slackbot_webhook_url=url)
# Create your message, you can use the usual formatting and layout blocks available from Slack
message = "Hello Slack :alert-emoji:, this is sent from `slack messenger`"
# The 'send_slack_msg' method will return a tuple with the first item boolean to represent if sending
# the message was successful and a second value including a string of text of
message_success, response_msg = sm.send_slack_msg(message=message)
print(f"SUCCESS: {message_success} RESPONSE MSG: {response_msg}")
Installing slack-messenger
Requests is available on PyPI:
$ python -m pip install slack-messenger
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
slack_messenger-0.1.1.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file slack_messenger-0.1.1.tar.gz
.
File metadata
- Download URL: slack_messenger-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b34c0250d3679fad235f3c2f4f63eb666fe6f5afde22cedbfcc10dda7b14ea3c |
|
MD5 | e25b569390fe7c7f01505f02d3e9dc71 |
|
BLAKE2b-256 | 87681fa9b9eb7cf3ec6ba6eb30bbf72e44462394700242348b1da94342e3278c |
File details
Details for the file slack_messenger-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: slack_messenger-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa5fecf11f2d1233c176642033408c4c28eae614c8b23ef235389b9da8cc4636 |
|
MD5 | 0f640468e5df8d280386caa928a888d7 |
|
BLAKE2b-256 | c58bf980ee74d4b15f86c44a2e607a71fe3d20e9a35fa730196cd29d7707bf23 |