Skip to main content

An APIwrapper for slack with python.

Project description

PyPI PyPI - License

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

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_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.3.0.tar.gz (18.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.3.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

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

Hashes for wsslack.py-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a63aa059e172c119bc09423f7686ed6241546ddc0be3b0d17f20e396330515ed
MD5 1fb06d21a474941993277ce782413fbe
BLAKE2b-256 73ef56652a503c5e47184a796e05f7b7871db334e47372023d8e6cde7a0ce45d

See more details on using hashes here.

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

Hashes for wsslack.py-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1231b875b67fa15f1affb4a4c5cef24098235493d20b26ea83374ff7bf6ce2d1
MD5 fbe9879d4f6896beb6a9554ab9d5296e
BLAKE2b-256 8ae47af26c9a70cc7a050648b9ac83772b515d402c0b999600308bff7fd85f69

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