Skip to main content

A framework for Slack RTM bots.

Project description

This library provides a simple asyncio based interface for writing RTM <https://api.slack.com/rtm> bots for Slack. Many distinct functions can be run through a single Slack bot plugin, triggered by user defined commands (e.g. !myCommand).

Example

A bot which can be triggered by the message !greet Guido looks like this:

from asyncbots.bot import SlackBot, register
from asyncbots.command import MessageCommand
from pyparsing import alphas, Word

class MyBot(SlackBot)
    def __init__(self):
        self.name = 'My Bot'

        # Match 'greet' followed by any word
        self.expr = 'greet' + Word(alphas).setResultsName('user')

    @register()
    async def handler(self, sender, channel, parsed_message):
        return MessageCommand('Hello ' + parsed_message['user'])

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

asyncbots-0.1.6.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

asyncbots-0.1.6-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file asyncbots-0.1.6.tar.gz.

File metadata

  • Download URL: asyncbots-0.1.6.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for asyncbots-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6e44ca1fd1413cac5f34ecfbabe3bbdf2c0fe4c4f2f2f3283370ec7e00e3f182
MD5 2d72719f995131d4faea1a941ac13c62
BLAKE2b-256 1fe14911e2e3a27a617e5f9d69db1deeade0ee6b273aed953b5990de025ba02b

See more details on using hashes here.

File details

Details for the file asyncbots-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for asyncbots-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 27ac7f7adee08517241613bd17ab255d24556898976955650368b7d5bcb2fc37
MD5 6aadbaa7ca81c3f14f88220116c4426f
BLAKE2b-256 44290521b6aa79314e9940fd8b74e5f3ed0b0438c63797ae2cc82d91d11c84a6

See more details on using hashes here.

Supported by

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