Skip to content

Commit

Permalink
added typing chat action
Browse files Browse the repository at this point in the history
  • Loading branch information
NivEz committed Mar 3, 2024
1 parent c261701 commit 75a86da
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"express": "^4.18.2",
"jsdom": "^23.0.1",
"keyv": "^4.5.4",
"telenode-js": "^1.4.1"
"telenode-js": "^1.5.0"
}
}
2 changes: 2 additions & 0 deletions src/bot/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const onStart = async (bot, messageBody) => {
};

const onSearch = async (bot, messageBody) => {
await bot.sendChatAction(messageBody.chat.id, 'typing');
const searchTerm = messageBody.text;
console.log(`Searching for: ${searchTerm}. Sender: [ ${messageBody.from.first_name} ].`);
const searchResults = await getSearchResults(searchTerm);
Expand Down Expand Up @@ -41,6 +42,7 @@ const onSearch = async (bot, messageBody) => {
};

const onClickSearchResultsMenu = async (bot, callbackQuery) => {
await bot.sendChatAction(callbackQuery.message.chat.id, 'typing');
const data = callbackQuery.data;
if (data.startsWith('tt')) {
// In that case data is the title ID
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,10 @@ symbol-tree@^3.2.4:
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==

telenode-js@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/telenode-js/-/telenode-js-1.4.1.tgz#bb25be078457df520b4a8d69abcef1945968952e"
integrity sha512-2i+6PU+AT8sh5PZSIRgqjy6N4Gg+hc0gJJW1FhvSN8WCfhZiXjCm4mrZWgNkuwInt+08VMZS+0HwS70cb5lzlw==
telenode-js@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/telenode-js/-/telenode-js-1.5.0.tgz#450527b3978ef507f4eeb4bc2be38839e4a97d39"
integrity sha512-LlJvI5DtXx+rb+r5XODRRP9UG79EWui+2fRRe4EgN1KuGSZ2kLaTgaEfwGxgBxwbFGxtTprPdDjkpWgdLBfDZw==
dependencies:
axios "^1.6.5"

Expand Down

0 comments on commit 75a86da

Please sign in to comment.