asyncbots-0.1.8
توضیحات
A framework for Slack RTM bots.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | asyncbots-0.1.8 |
| نام | asyncbots |
| نسخه کتابخانه | 0.1.8 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Davis Yoshida |
| ایمیل نویسنده | dyoshida@ttic.edu |
| آدرس صفحه اصلی | https://github.com/davisyoshida/asyncbots |
| آدرس اینترنتی | https://pypi.org/project/asyncbots/ |
| مجوز | MIT |
AsyncBots
==========
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:
.. code:: python
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'])
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.5 | Python |
نحوه نصب
نصب پکیج whl asyncbots-0.1.8:
pip install asyncbots-0.1.8.whl
نصب پکیج tar.gz asyncbots-0.1.8:
pip install asyncbots-0.1.8.tar.gz