Python SDK for RCS MaaP chatbot
Project description
rcs_chatbot
A Python SDK for RCS MaaP chatbots.
Installation
pip install rcs_chatbot
Example
See more examples in the example folder.
import flask
import rcs_chatbot
chatbot = rcs_chatbot.Chatbot(
"API_URL",
"BOT_ID",
"TOKEN"
)
app = flask.Flask(__name__)
@app.route('/', methods=['POST'])
def event():
try:
chatbot.processEvent(flask.request.get_json())
return "ok", 200
except:
pass
@chatbot.registerEventHandler(rcs_chatbot.EventType.MESSAGE)
def messageHandler(event):
contact = rcs_chatbot.MessageContact("+18055551234", None)
suggestions = rcs_chatbot.Suggestions()
suggestions.addReply("reply", "reply")
suggestions.addUrlAction("url", "url", "http://example.com")
chatbot.sendMessage(contact, "Howdy", suggestions)
if __name__ == '__main__':
app.run(port=5000, debug=False)
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
rcs_chatbot-0.0.2.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for rcs_chatbot-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fcf829cdf36884167fb75ec69961dd0b5c944d439b55e39de2ee7e344b4c09e |
|
MD5 | 1e3b24fdcb8e6e197ea003fb9b3dca15 |
|
BLAKE2b-256 | 01b431e9d1466eac30aed92f601ff1b7717b689b15c5876ebf297719f243bcb3 |