An APIwrapper for slack with python.
Project description
An API wrapper with Slack written in Python.
Key feature
- Modern Pythonic API using
asyncandawait. - API and interactive components of the platform by utilizing websockets.
Document for slack.py
How to install
:warning: If you have slack_bolt installed, you cannot import this package. You may have file conflicts.
$ pip install wsslack.py
Example
Event References
import slack
client = slack.Client(
user_token="...",
bot_token="...",
token="..."
)
@client.event
async def on_message(message: slack.Message):
if message.content.startswith("!"):
await message.channel.send("Hello.")
@client.event
async def on_channel_create(channel: slack.Channel):
await channel.send("Hello!")
client.run()
on_message
on_channel_create
Commands usage.
New style of messaging. If you use app with commands..
from slack import commands
bot = commands.Bot(..., prefix="!")
@bot.command(name="msg")
async def message(ctx: commands.Context, *args):
await ctx.channel.send("message received!")
@bot.command()
async def ping(ctx: commands.Context, *args):
await ctx.channel.send("pong!")
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
wsslack.py-1.4.1.tar.gz
(24.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wsslack.py-1.4.1.tar.gz.
File metadata
- Download URL: wsslack.py-1.4.1.tar.gz
- Upload date:
- Size: 24.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f193e3e2dc92e3032d1004acae32700a789fd87774484c899b8e912e1facf1
|
|
| MD5 |
ba14d958a84797c32b43daf2c75195a0
|
|
| BLAKE2b-256 |
89f7bb8d7cce4a50ac72526f3a10737f96d7fd762b1a411e1f1c997d4ac1783d
|
File details
Details for the file wsslack.py-1.4.1-py3-none-any.whl.
File metadata
- Download URL: wsslack.py-1.4.1-py3-none-any.whl
- Upload date:
- Size: 31.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4c5032be841fd5370baf3be60c40449bab9afd01a5ac053420d766f86e3ff24
|
|
| MD5 |
a84f7740406c4903807a7e928ecdad26
|
|
| BLAKE2b-256 |
76f3791c16e17a857b34f86c05c479142dc2335c00b58418153e5fde231239b5
|