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
Release history Release notifications | RSS feed
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.2.tar.gz
(13.2 kB
view details)
Built Distribution
asyncbots-0.1.2-py3-none-any.whl
(16.8 kB
view details)
File details
Details for the file asyncbots-0.1.2.tar.gz
.
File metadata
- Download URL: asyncbots-0.1.2.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ebed5b602798f3288df646e9926a9a512bbd6450b7f47e84635f4a4a0e4ef73 |
|
MD5 | ddffe3c929107f11baaf371ff3ad3608 |
|
BLAKE2b-256 | cfff4b23d86eda785f79943b5c7f36b00e6b67c0e0fe69dc199e394a9a94bdee |
File details
Details for the file asyncbots-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: asyncbots-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a1f5e6042f1116ec522374e94d714fe5ea799f98d8302b07b16954a76f9162 |
|
MD5 | cb90208bf861227960af8366c5d6afdd |
|
BLAKE2b-256 | 247f5db0bd6aab821eed85f7d116694d9c649574dd9996c9762630ec50978f4a |