카카오챗봇 JSON helper
Project description
카카오톡 챗봇 빌더 도우미
Python언어 전용
소개
Python 언어로 카카오 챗봇 서버를 만들 때 좀 더 쉽게 JSON 메시지 응답을 만들 수 있게 도와줍니다.
SimpleText, SimpleImage, ListCard, Carousel, BasicCard, CommerceCard, ItemCard 등의
챗봇 JSON 데이터를 쉽게 만들 수 있도록 도와줍니다.
설치
pip install pykakao
사용법
ListCard 예제
from pykakao import Button, Kakao, ListItem
k = Kakao()
k.add_qr("오늘", "카톡 발화문1")
k.add_qr("어제") # label becomes also messageText
list_card = k.init_list_card().set_header("리스트 카드 제목")
list_card.add_button(Button("그냥 텍스트 버튼", "message"))
list_card.add_button(k.init_button("link label").set_link("https://google.com"))
list_card.add_button(
k.init_button("share label").set_action_share().set_msg("카톡에 보이는 메시지")
)
list_card.add_button(k.init_button("call label").set_number("010-1234-5678"))
list_card.add_item(
ListItem("title").set_desc("description").set_link("https://naver.com")
)
k.add_output(list_card)
print(k.to_json())
/*
Result:
{
"template": {
"outputs": [
{
"listCard": {
"buttons": [
{
"label": "그냥 텍스트 버튼",
"action": "message"
},
{
"label": "link label",
"action": "webLink",
"webLinkUrl": "https://google.com"
},
{
"label": "share label",
"action": "share",
"messageText": "카톡에 보이는 메시지"
},
{
"label": "call label",
"action": "phone",
"phoneNumber": "010-1234-5678"
}
],
"header": {
"title": "리스트 카드 제목!"
},
"items": [
{
"title": "title",
"description": "description",
"link": {
"web": "https://naver.com"
}
}
]
}
}
],
"quickReplies": [
{
"action": "message",
"label": "오늘",
"messageText": "오늘 공지 보여줘"
},
{
"action": "message",
"label": "어제",
"messageText": "어제 공지 보여줘"
}
]
},
"version": "2.0"
}
*/
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
kakao_json-1.0.1.tar.gz
(12.3 kB
view hashes)
Built Distribution
kakao_json-1.0.1-py3-none-any.whl
(13.3 kB
view hashes)
Close
Hashes for kakao_json-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5de4dbab9e60e0274a6608906bf1be306585247f78a7255275ae7dee60473fd |
|
MD5 | 8e2cbac9c7342b5203e9df7deaa0e924 |
|
BLAKE2b-256 | 4e17b18ae822be9f589bf9ecb01dea18db680801f026db6314305cc75ad96e79 |