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

Uploaded Source

Built Distribution

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

asyncbots-0.1.3.dev1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file asyncbots-0.1.3.dev1.tar.gz.

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev1.tar.gz
Algorithm Hash digest
SHA256 af763b85fa79c411a95044b18515ed2ed6ef0afc18a1fabc47f7072f721c052c
MD5 a2214f70e41a01588cd9876ff061a315
BLAKE2b-256 1642ba14c0d462e5c55bc9bfeee81c9f2817733fae799c2cd71e76283f3bbae2

See more details on using hashes here.

File details

Details for the file asyncbots-0.1.3.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a5aef67601372cc5af6d37ec72265b81a040e1174ad80ee0032e0e51f11ed9d
MD5 5dd4a7f0e1398d65738c9212005f185f
BLAKE2b-256 f1183b6f8b4ef19ada5159ab21afb5df3932641e658cc6e60b3785679396d382

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