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.dev0.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.dev0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev0.tar.gz
Algorithm Hash digest
SHA256 de37739fe6999987fcd6ac158a4314161a73574e395adfc5fba9bae5036b7e04
MD5 88d14a93e3c8823a55f4fd07ac010b1c
BLAKE2b-256 fee32f68f54d3579ad4db7823add4aabea68a4ad2bce165125a1bd28a134edab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.3.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 b77a6c8e36521cbad59eead73ec988b193eb6bfa202afe7a94f44bd844b8638b
MD5 44048d907f2fdd603a7cae8e03ea093d
BLAKE2b-256 8202d8e33f187a5e57943b8bdbdd39156a7da2dfbb5c47d6320f8b3364de3180

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