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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev2.tar.gz
Algorithm Hash digest
SHA256 c18aca3dfbacee79c4ae04bc77eb6e06dc66192f9a7042b9297e20331b06c3e8
MD5 56b0d0a71db8ee85c48693520d36f6f3
BLAKE2b-256 8ef0ea69d418b862f4061d7513d350ea02bacdb187359c394f4c0490d15899fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 4c6571f23b63918fb111696b2db98fc02fd2a30b79946adce2a918b4c7f3dd76
MD5 770928df575b7dab4378ef0409745e0f
BLAKE2b-256 5959fa39003f8fb30a2aaa4e54e40b5df11b4b465c6a87dc089ccf3b33a0f0d8

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