-
Notifications
You must be signed in to change notification settings - Fork 0
en quickstart
Katinor edited this page Sep 5, 2018
·
1 revision
To install the library, you can just run the following command:
pip install kakaobot.py
You can use import kakaobot
after you install
https://github.com/Katinor/kakao_bot.py.prac
import kakaobot
app = kakaobot.Client(port = 7900)
###########################
# Just add what you want! #
###########################
app.run()
Very simple! Declare kakaobot.Client, Register Commands you want, and call kakaobot.Client.run() method.
Foe example, You can make chatbot to say "Hello" when "Hi" has been heard.
import kakaobot
app = kakaobot.Client(port = 7900)
@app.add_command()
def Hi():
return kakaobot.Message(text = "Hello")
app.run()
You can force user to answer using button only. check below.
import kakaobot
init_kb = kakaobot.Kboard(button = ["Hi"])
app = kakaobot.Client(port = 7900, kboard = init_kb)
@app.add_command()
def Hi():
return kakaobot.Message(text = "Hello")
app.run()