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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for asyncbots-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9957fe02740e3152af1005199399b1254a9425f4ed1217343f4cb7d4ca917112
MD5 6a2054c4e189b7d4b2326cfc3c80fec1
BLAKE2b-256 5e8d4845c67ab8881e48d250b37852353cd3b07b453443680786c112d871a185

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for asyncbots-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 27d0b9ae3530d8c3171a3d0b4a4ffe926dc7509ecc9c295e8e5dc2dead1d6511
MD5 501cd650225773abc5ed9b3f0de700b1
BLAKE2b-256 de190ce43748eff3cde37060fd588793731304d7efeaa5c5729342ac0a4d7e86

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