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.3.tar.gz
(13.2 kB
view details)
Built Distribution
asyncbots-0.1.3-py3-none-any.whl
(16.8 kB
view details)
File details
Details for the file asyncbots-0.1.3.tar.gz
.
File metadata
- Download URL: asyncbots-0.1.3.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff3685d1563405bce38858c52ab26049a8aaa628305651c16fde3802ec38e7ff |
|
MD5 | c85ff095ca1db005526cc7a77d918be1 |
|
BLAKE2b-256 | 96c78254777701389c4628844c526db1ee68a9ecdd6f6df2696d5021410a06d8 |
File details
Details for the file asyncbots-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: asyncbots-0.1.3-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55c6e0a104aec74ebc69c31b9960b0035067ea2703febc6b509066ac5222fc53 |
|
MD5 | d3c9b95e80bd0c37fc5fc63c380c61c0 |
|
BLAKE2b-256 | 539261d0978113a60616fdbfd6941f3db93897b95d0eebcb576eebf4ce7552d8 |