Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hwonyo/kakaoplus
https://github.com/hwonyo/kakaoplus
chatbot kakao kakaotalk kakaotalk-api kakaotalk-bot python
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hwonyo/kakaoplus
- Owner: hwonyo
- License: mit
- Created: 2017-10-22T12:16:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-19T22:12:16.000Z (almost 4 years ago)
- Last Synced: 2024-10-03T13:38:47.456Z (4 months ago)
- Topics: chatbot, kakao, kakaotalk, kakaotalk-api, kakaotalk-bot, python
- Language: Python
- Size: 29.3 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# kakaoplus
[![PyPI](https://img.shields.io/pypi/v/kakaoplus.svg?v=1&maxAge=3601)](https://pypi.python.org/pypi/kakaoplus)
[![Coverage Status](https://travis-ci.org/HwangWonYo/kakaoplus.svg?branch=master)](https://coveralls.io/github/wonyoHwang/kakaoplus?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/HwangWonYo/kakaoplus/badge.svg?branch=master)](https://coveralls.io/github/HwangWonYo/kakaoplus?branch=master)
[![PyPI](https://img.shields.io/pypi/l/kakaoplus.svg?v=1&maxAge=2592000)](https://pypi.python.org/pypi/kakaoplus)Python Handy Webhook Handler For Using KaKao Plus Friend Auto Reply
Inspired By : https://github.com/conbus/fbmq
# Install
```
pip install kakaoplus
```# Handle webhook
Handle kakaotalk plus friend auto_reply### Usage (with flask)
```python
from flask import Flask, request
from kakao import KaKaoAgentapp = Flask(__name__)
KaKao = KaKaoAgent()@app.route('/keyboard', methods=['GET'])
def keyboard_handler():
res = KaKao.handle_keyboard_webhook()return res
@app.route('/message', methods=['POST'])
def message_handler():
req = request.get_data(as_text=True)
res = KaKao.handle_webhook(req)return res
@KaKao.handle_keyboard
def keyboard_handler(res):
'''
:param req: request from kakao
:param res: response
'''
res.keyboard_buttons = [
'button1',
'button2',
'button3'
]@KaKao.handle_message
def handle_message(req, res):
'''
:param req: request from kakao
:param res: response
'''
echo_message = req.contentres.text = "Echo Message: " + echo_message
@KaKao.handle_message(['hello', 'hi'])
def greeting_callback(req, res):
'''
:param req: request from kakao
:param res: response
'''
res.text = "Hello :)"
```