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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for asyncbots-0.1.7.tar.gz
Algorithm Hash digest
SHA256 57bc2ded5b3e08d292faf40843f8910c3b41b2bb606e8e7c42ebb71411d17b97
MD5 4a54dd56f31a5acfc3b182d9ee7debae
BLAKE2b-256 cd12eba2957c787e6cfc9ff5fcca274aabac8e946f204303429ae69a3490420a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 0f6f9d1f162515525dc50d482c9e5a00e8db5f340c70f38e45ba87510dcf3899
MD5 7fcb5838d5f2fec153d6f01a085b655a
BLAKE2b-256 d9c253b09e0d57f346dc58c90a34c43d20a8d5327d89b1b6702de90a93c469b6

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