diff --git a/src/triggers/line/message/index.js b/src/triggers/line/message/index.js index 02ce7fa..84abd01 100644 --- a/src/triggers/line/message/index.js +++ b/src/triggers/line/message/index.js @@ -25,8 +25,6 @@ module.exports = async (event) => { text: messageText, } = message; - const sourceId = whereSentMessageEvent(event); - let requestContent = messageText; if (sourceType !== "user" && !requestContent.startsWith(prefix)) { return; @@ -35,6 +33,11 @@ module.exports = async (event) => { requestContent = requestContent.slice(prefix.length).trim(); } + const sourceId = whereSentMessageEvent(event); + if (sourceType === "user") { + await client.showLoadingAnimation({chatId: sourceId}); + } + if (!requestContent) { await client.replyMessage({ replyToken,