help.py
4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#-*-coding: utf-8 -*-
import os
import sys
from flask import request
import datetime
import random
sys.path.append(os.path.dirname(os.path.dirname("main")))
from Functions.getInstance import *
from Functions.checkFunction import *
from Functions.updateDatabase import *
from Functions.messageTypes import *
from Config import intentBlockId
# 도움말 시작
def get_startHelp_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
outputList.append(simpleText('[시스템] 무엇이 궁금하신가요?'))
# help button window
qrList = helpButtonWindow()
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]메인', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)
def get_quitHelp_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
petId = getPetId(kakaoUserKey)
petName = getPetName(petId)
outputList.append(simpleText('[시스템] 언제든지 다시 질문해주세요'))
# 챗봇 노란버튼
qrList = basicButtonWindow(petName)
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]종료', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)
def get_serviceIntroduction_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
petId = getPetId(kakaoUserKey)
petName = getPetName(petId)
card_list = serviceIntroductionCardList(petName)
outputList.append(cardArray(card_list))
outputList.append(simpleText('도기보기와 함께라면 밖에서도 우리집 ' + petName + '와 채팅할 수 있어요😊'))
outputList.append(simpleText(petName + '와 카톡할 준비 되셨나요?'))
# help button window
qrList = helpButtonWindow()
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]서비스 소개', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)
# QR코드 스캔 도움말
def get_helpQrScan_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
outputList.append(simpleText('[시스템] 카메라 초점을 맞춰서 스캔해보시겠어요?'))
outputList.append(simpleText('그래도 스캔이 잘 되지 않는다면 연락주세요\n\n📧: petpeotalk@gmail.com'))
qrList.append(blockQuickReply('돌아가기↩️', '돌아가기↩️', intentBlockId.help))
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]QR코드스캔', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)
# 사진추가 도움말
def get_helpAddImage_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
petId = getPetId(kakaoUserKey)
petName = getPetName(petId)
outputList.append(simpleText('물론이에요!'))
outputList.append(simpleText('귀여운 ' + petName + '사진은 언제든지 추가 가능합니다😍'))
qrList.append(blockQuickReply('사진추가하기📸', '사진추가하기📸️', '5d4251ca8192ac0001b8d96e'))
qrList.append(blockQuickReply('돌아가기↩️', '돌아가기↩️', intentBlockId.help))
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]사진추가', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)
# 사용인원 도움말
def get_helpCapacity_message():
contextList = []
outputList = []
qrList = []
payload = request.get_json()
kakaoUserKey = getKakaoUserKeyFromPayload(payload)
outputList.append(simpleText('아쉽게도 아직은 공기계 한 대당 한 명만 이용하실 수 있습니다'))
outputList.append(simpleText('머지않아 온가족이 도기보기와 함께할 수 있어요!\n'
'기대해주실거죠?☺'))
qrList.append(blockQuickReply('돌아가기↩️', '돌아가기↩️', intentBlockId.help))
# 메시지 로그 저장 sender: bot, receiver: user
addMessageLogs('bot', kakaoUserKey, '[도움말]사용인원', datetime.datetime.now(), 'none')
return ordinaryMessageType(contextList, outputList, qrList)