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.2.tar.gz
(27.1 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.2.tar.gz.
File metadata
- Download URL: wsslack.py-1.4.2.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0ab712381a6517d711be538dea26a6ebbf07443560d590792a9c65bc92cd415
|
|
| MD5 |
17b5dd18d3ba9e1a27bc988a3b738ce9
|
|
| BLAKE2b-256 |
ca777e01720dad6271213e136b57feab60422dc09be28ac6a98388c3956216f1
|
File details
Details for the file wsslack.py-1.4.2-py3-none-any.whl.
File metadata
- Download URL: wsslack.py-1.4.2-py3-none-any.whl
- Upload date:
- Size: 36.0 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 |
37392fce7a9374c0979ff3edda45c8b549970509dd246b2a4a0bd01d7cb6cb3e
|
|
| MD5 |
8b4b0334c2088a787ab4a44485715efd
|
|
| BLAKE2b-256 |
636ffb8cb7f0cb3e0b591ddae9123ddbdbf104c6513192ec506a39a2a11574ff
|