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.

$ 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_message

on_channel_create

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

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.0.tar.gz (20.3 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.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wsslack.py-1.4.0.tar.gz
  • Upload date:
  • Size: 20.3 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.0.tar.gz
Algorithm Hash digest
SHA256 c591425dca4e971e8c5a3b25ccef45ad60b3226cec9ac2b19dcf9e8189b398e0
MD5 063b265e0aadef80615557f19f817e7d
BLAKE2b-256 65a0e258b1290214b1bdefee8ad81b4e7811b4723ad06112d686a7de279f3a29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wsslack.py-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88dc748a6351c8b43b79aa2b411aee5f16f09a8add7aa206d82a242cc54c471e
MD5 fa893945be04d062c0a5a0f322428eb1
BLAKE2b-256 bd71d954329a34e162e605e7734269664266c501899bf148d3b9657c64a09e7f

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