slackbot
A simple python wrapper for the Slack api
Requirements
Installation
pip install simple-slackbot
Usage
Generate a slack api token
First you need to get the slack api token for your bot. You can create a bot on the slack website and manage permissions.
Instantiate a SlackBot
from slackbot import SlackBot
slackbot = SlackBot()
By default, the SlackBot retrieved the slack token from environment variable SLACK_API_TOKEN.
You can overwrite the default behaviour by instantiating with the token argument.
If running it in a Jupyter notebook, instantiate with run_async=True.
Send a message
You can send messages to any channel (using the channel name or id), or any user (just set channel=@<username>)
slackbot.send_message(channel='#general', message='Hello!')
Send a file
You can also send files over slack, to any channel or user.
slackbot.send_file(channel='#general', file='<filepath>', message='Check out this file!')
More using the slack api directly
You can access methods from the raw slack client to use them directly.
slackbot.client.chat_postMessage(...)
Metadata
Release files for simple-slackbot 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| simple-slackbot-0.1.0.tar.gz | 2.3 kB | Without provenance | Details for simple-slackbot-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_slackbot-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for simple_slackbot-0.1.0-py3-none-any.whl |
Total release size: 17.4 kB
Release files / simple-slackbot-0.1.0.tar.gz
| Download URL | simple-slackbot-0.1.0.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee2b8acb2577e6bdacf3ae2cca488063d6f504e0ceff7cf5d89da2656a1d5b2a
|
|
BLAKE2b-256 checksum How to use checksums |
e22c9cc93185985c0faa6ceb690b987582a93f1fd4ccaa5e8528fb78f90cb1af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Release files / simple_slackbot-0.1.0-py3-none-any.whl
| Download URL | simple_slackbot-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94b9bb1debd1350a1d0572c8268e7df810b55b9796eb956d1197a63a7f079134
|
|
BLAKE2b-256 checksum How to use checksums |
57bdeb7ad11ae1108f6b37ba1c2d311f7ae04e079a8229d7b49a6b0295e66d7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2
|
Security for simple-slackbot 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.