Skip to content

Commit

Permalink
Add loading animation & update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
blafea committed Jun 24, 2024
1 parent cfc4d93 commit 28433c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
from linebot.v3.exceptions import InvalidSignatureError
from linebot.v3.messaging import (AsyncApiClient, AsyncMessagingApi,
Configuration, ReplyMessageRequest,
TextMessage, PostbackAction, QuickReply, QuickReplyItem)
TextMessage, QuickReply, QuickReplyItem,
ShowLoadingAnimationRequest)
from linebot.v3.webhooks import (FollowEvent, JoinEvent, LeaveEvent,
MessageEvent, TextMessageContent,
UnfollowEvent, PostbackEvent)
PostbackAction()

CHANNEL_SECRET = os.getenv('LINE_CHANNEL_SECRET', None)
CHANNEL_ACCESS_TOKEN = os.getenv('LINE_CHANNEL_ACCESS_TOKEN', None)
HF_API_TOKEN_LIST = os.getenv('HF_API_TOKEN_LIST', None)
Expand Down Expand Up @@ -154,7 +155,7 @@ async def send_help_message(self, event: MessageEvent):
async def handle_text_message(self, event: MessageEvent):
logger.debug(f"Got message: {event.message.text}")
input_text = event.message.text.strip()

await self.line_bot_api.show_loading_animation(ShowLoadingAnimationRequest(chatId=event.source.user_id))
if input_text == f"{self.BOT_NAME}幫幫我":
logger.info(f"幫幫我 by {event.source.user_id}")
await self.send_help_message(event)
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aenum==3.1.15
aiohttp==3.9.0
aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.6.0
anyio==3.7.1
Expand All @@ -21,7 +21,7 @@ future==0.18.3
idna==3.6
itsdangerous==2.1.2
Jinja2==3.1.2
line-bot-sdk==3.5.1
line-bot-sdk==3.11.0
MarkupSafe==2.1.3
motor==3.4.0
multidict==6.0.4
Expand Down

0 comments on commit 28433c6

Please sign in to comment.