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.
# stable
$ pip install wsslack.py
# latest
$ pip install git+https://github.com/peco2282/slack.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.4.tar.gz
(33.0 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.4.tar.gz.
File metadata
- Download URL: wsslack.py-1.4.4.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c6d33c89e1e1e9a3560e301fdfe5c5c9a7887043e8f1af3a57b77ee6a24809c
|
|
| MD5 |
90cd767dc29dd7a41d144bbdbafde863
|
|
| BLAKE2b-256 |
21890b2fcca908d43d288e7d1bba6d701ab1d80e60f2a67a134d649c48ae58b1
|
File details
Details for the file wsslack.py-1.4.4-py3-none-any.whl.
File metadata
- Download URL: wsslack.py-1.4.4-py3-none-any.whl
- Upload date:
- Size: 43.4 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 |
6168638b16d968c0d78720930853dee7664fd3989b2ec8e95d2fa6927c4714d3
|
|
| MD5 |
ca0ab1b36530ad8867de861236fa607d
|
|
| BLAKE2b-256 |
fd44901b62d4e0bdad6f37c046301bd8b400212aae1884e125b976bc8c786dbc
|