Skip to main content

An APIwrapper for slack with python.

Project description

PyPI PyPI - License PyPI - Downloads

An API wrapper with Slack written in Python.

Key feature

  • Modern Pythonic API using async and await.
  • 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_message

on_channel_create

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!")

msg

ping

Project details


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.3.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wsslack.py-1.4.3-py3-none-any.whl (43.0 kB view details)

Uploaded Python 3

File details

Details for the file wsslack.py-1.4.3.tar.gz.

File metadata

  • Download URL: wsslack.py-1.4.3.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for wsslack.py-1.4.3.tar.gz
Algorithm Hash digest
SHA256 5bb835d08c3a2ee5abd372751cd3728d5cf240f78600478dd9e80c62eb6651f7
MD5 f37735647dc342f1d6d30cd4de60840a
BLAKE2b-256 a8cc4711b0d64ec3e21a7f4a02fc70eb01d0f8fbe10d15c9fed532e674208adf

See more details on using hashes here.

File details

Details for the file wsslack.py-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: wsslack.py-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 43.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for wsslack.py-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 10763899c5fd59c7de2c4e79e710c8cf7bb49f1a27baa36d4ae4d2262d451eec
MD5 3f415af89c6775a396562bba634fd5b3
BLAKE2b-256 5934d7acbee1ecfbad0efcdb93532e178033c8063f0e7816186ca3fe59aa15f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page