Skip to content

Commit aa9947d

Browse files
committed
Remove unnecessary quick reply button
1 parent fc52713 commit aa9947d

2 files changed

Lines changed: 15 additions & 31 deletions

File tree

linebot/app/services/handlers/common.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,30 @@
1616

1717
# 常用指令
1818
COMMANDS = {
19-
"/help": (
20-
"📚 可用的指令列表:\n"
21-
"1. /help - 顯示此幫助訊息\n"
22-
"2. /setup - 設定相關功能\n"
23-
"3. /hint - 小提示\n\n"
24-
"💡 您也可以直接輸入問題,我會盡力協助您!"
25-
),
26-
"/setup": "⚙️ 設定功能開發中,敬請期待!",
2719
"/hint": [
2820
"我有時候比較笨啦,可能會回答錯誤或不完整的資訊,這時候你可以點擊下方的「清除對話紀錄」按鈕,讓我重新學習!",
2921
"如果你發現我回答的內容不正確,請隨時告訴我,我會努力改進!",
30-
"我在回答之前會先將你的問題分類,但是... 有時候我也會分類錯誤,所以如果你發現我回答的內容不對,可以嘗試清除我的記憶歐!",
31-
"其實我的腦袋是用 Dify 這個工具串起來的歐,至於我真正的腦袋是 Gemini 還是 gpt 呢?...這個我就不知道了哈哈哈",
32-
"還沒追蹤我們ㄉ˙ IG 嗎?快來追蹤我們吧!",
22+
"我在回答之前會先將你的問題分類,但是... 有時候我也會分類錯誤,所以如果你發現我回答的內容不對,可以嘗試清除我聊天記錄歐!",
23+
"其實我的腦袋是用 Dify 這個工具串起來的歐,至於我真正的腦袋是 Gemini 還是 gpt 呢?...這個我就不知道了哈哈哈,可能我是混血兒",
24+
"還沒追蹤我們ㄉ IG 嗎?快來追蹤我們吧!點下面的按鈕可以找到 IG 喔",
3325
"不知道有沒有其他學校的人做這種東西,像我這種賠錢貨,應該是第一個吧?",
34-
"你想看提示喔,我只想睡覺zzz",
35-
"其實我是有使用限制的歐,如果你跟我聊太久,我會需要休息一下,不過你放心好了,我會跟你說我要休息多久",
36-
"👺 到底要什麼時候才會用到這個表情符號?",
37-
"如果覺得心情不好的話,我通常都會去散步",
26+
"其實我是有使用限制的歐,如果你跟我聊太久,我會需要休息一下,不過你放心好了,我會跟你說我要休息多久!",
3827
"沒有人懂過我...,大家只會罵我笨,也不想想我有多努力",
28+
"偷偷告訴你,一開始的設定語言和身份的功能其實還沒有完成QQ,但我還是會記得你的設定,有朝一日會完成的!",
29+
"因為我還有點笨,回答前可能會想比較久,所以我會顯示一個 loading 動畫,讓你知道我正在努力回答你的問題!",
30+
"我在思考的時候會把你的問題先分類一次,不過呢...有時候我會分類錯誤,所以如果你發現我回答的內容怪怪,可以嘗試清除聊天記錄歐!",
31+
"如果你想要學習開發 LLM 應用,可以參考看看這個系列文章 -> https://ithelp.ithome.com.tw/users/20168885/ironman/7699 (我在這邊打廣告應該不會被罵吧哈哈哈)",
32+
3933
],
40-
"🚧 尚未施工完畢,敬請期待! 🚧": "🚧 尚未施工完畢,敬請期待! 🚧",
34+
"🚧 尚未施工完畢,敬請期待! 🚧": "🚧 尚未施工完畢,敬請期待! 🚧", # for future use
4135
}
4236

4337

4438
def create_quick_reply() -> QuickReply:
4539
"""建立快速回覆按鈕"""
4640
return QuickReply(
4741
items=[
48-
QuickReplyButton(action=MessageAction(label="說明", text="/help")),
49-
QuickReplyButton(action=MessageAction(label="設定", text="/setup")),
50-
QuickReplyButton(action=MessageAction(label="💡", text="/hint")),
42+
QuickReplyButton(action=MessageAction(label="小提示 💡", text="/hint")),
5143
]
5244
)
5345

linebot/app/services/handlers/postback.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from ...config.line_config import line_bot_api
1010
from ..utils import flex_message_convert_to_json
1111
from ...repositories.user_repository import UserRepository
12+
from .common import create_quick_reply
1213

1314
logger = get_logger(__name__)
1415
user_repository = UserRepository()
@@ -26,15 +27,6 @@
2627
我們的資料涵蓋到「宿舍」「社團」「學校活動」「課程」「常見行政手續」「成大法規彙編」等六大主題。請注意,本服務僅提供輔助資訊,具體內容仍應以學校官方公告為準。使用者在使用本服務時,應遵守學校相關規定與法律法規,並對自己的行為負責。"""
2728

2829

29-
def create_quickreply():
30-
return QuickReply(
31-
items=[
32-
QuickReplyButton(action=MessageAction(label="說明", text="/help")),
33-
QuickReplyButton(action=MessageAction(label="設定", text="/setup")),
34-
]
35-
)
36-
37-
3830
def create_example_question_quickreply(questions: list[str]):
3931
return QuickReply(
4032
items=[
@@ -107,7 +99,7 @@ def handle_postback_event(event):
10799
return [
108100
TextSendMessage(text="您已經設定為教職員身份,鵝子歡迎您!"),
109101
TextSendMessage(
110-
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quickreply()
102+
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quick_reply()
111103
),
112104
]
113105
elif data == "role_student":
@@ -116,7 +108,7 @@ def handle_postback_event(event):
116108
return [
117109
TextSendMessage(text="您已經設定為學生身份,鵝子歡迎您!"),
118110
TextSendMessage(
119-
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quickreply()
111+
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quick_reply()
120112
),
121113
]
122114
elif data == "role_visitor":
@@ -125,7 +117,7 @@ def handle_postback_event(event):
125117
return [
126118
TextSendMessage(text="您已經設定為校外人士身份"),
127119
TextSendMessage(
128-
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quickreply()
120+
text=WELCOME_MESSAGE_AFTER_SETTING, quick_reply=create_quick_reply()
129121
),
130122
]
131123
elif data == "clear_conversation_id":

0 commit comments

Comments
 (0)