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.
Install
:warning: If you are installed slack_bolt, you cannot import this package. files may be confrict.
$ pip install wsslack.py
example
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
extentional usage.
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.3.0.tar.gz
(18.3 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.3.0.tar.gz.
File metadata
- Download URL: wsslack.py-1.3.0.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a63aa059e172c119bc09423f7686ed6241546ddc0be3b0d17f20e396330515ed
|
|
| MD5 |
1fb06d21a474941993277ce782413fbe
|
|
| BLAKE2b-256 |
73ef56652a503c5e47184a796e05f7b7871db334e47372023d8e6cde7a0ce45d
|
File details
Details for the file wsslack.py-1.3.0-py3-none-any.whl.
File metadata
- Download URL: wsslack.py-1.3.0-py3-none-any.whl
- Upload date:
- Size: 22.7 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 |
1231b875b67fa15f1affb4a4c5cef24098235493d20b26ea83374ff7bf6ce2d1
|
|
| MD5 |
fbe9879d4f6896beb6a9554ab9d5296e
|
|
| BLAKE2b-256 |
8ae47af26c9a70cc7a050648b9ac83772b515d402c0b999600308bff7fd85f69
|