A package to build serverless chatbot on bothub.studio
Project description
This package provide components to works with Bothub.studio, which is a chatbot hosting service.
With bothub-cli, you can deploy a new chatbot with just four lines of commands.
Installation
To install bothub:
$ pip install bothub
The bothub package works on python2 and 3 both.
Getting Started
You can build a echo chatbot simply by subclassing BaseBot class and overriding handle_message method.
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function, unicode_literals)
from bothub_client.bot import BaseBot
class Bot(BaseBot):
"""Represent a Bot logic which interacts with a user.
BaseBot superclass have methods belows:
* Send message
* self.send_message(message, user_id=None, channel=None)
* Data Storage
* self.set_project_data(data)
* self.get_project_data()
* self.set_user_data(data, user_id=None, channel=None)
* self.get_user_data(user_id=None, channel=None)
When you omit user_id and channel argument, it regarded as a user
who triggered a bot.
"""
def handle_message(self, event, context):
self.send_message(event['content'])
License
This package is licensed under AGPLv3 for non-commercial personal use. If you want to use this package for commercial use, please contact to bothub@bothub.studio.
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
Built Distribution
File details
Details for the file bothub-0.1.0.tar.gz
.
File metadata
- Download URL: bothub-0.1.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32ef7d250389edc5b9a3eccfa1baa89782306db735c11c81fd0d68297d15af2d |
|
MD5 | e241e6a7461fa70d1ed0dcb4e0a49fbe |
|
BLAKE2b-256 | 7cbe30ddf2291ba5f2051ec45ed31467d354ff6e9af02d2299ff5cba604c75a4 |
File details
Details for the file bothub-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: bothub-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa61df93fd0b79c5c5c8850529c3b80a5db98321d714e0e4da56ebd7cdd9801a |
|
MD5 | 10b356933f4699e4411690053d360553 |
|
BLAKE2b-256 | 144c581984ee07d63dc19d27292b09a4beb26a85d3c6e7d4755b78e1858e42d8 |