After modifying TELEGRAM_ACCESS_TOKEN and TELEGRAM_CHAT_ID Value and running npm run test:notification, it should send a message on the discussion in Telegram
0 verbose cli [
0 verbose cli '/usr/local/Cellar/node/15.3.0/bin/node',
0 verbose cli '/usr/local/bin/npm',
0 verbose cli 'run',
0 verbose cli 'test:notification'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 3ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/Users/sami/Documents/streetmerchant/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/Users/sami/.npmrc Completed in 2ms
11 timing config:load:user Completed in 2ms
12 timing config:load:file:/Users/sami/.npm-global/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 10ms
19 verbose npm-session 85eb9c9beb684256
20 timing npm:load Completed in 19ms
21 timing command:run-script Completed in 9601ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:376:20)
22 verbose stack at maybeClose (node:internal/child_process:1055:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
23 verbose cwd /Users/sami/Documents/streetmerchant
24 verbose Darwin 20.1.0
25 verbose argv "/usr/local/Cellar/node/15.3.0/bin/node" "/usr/local/bin/npm" "run" "test:notification"
26 verbose node v15.3.0
27 verbose npm v7.0.14
28 error code 1
29 error path /Users/sami/Documents/streetmerchant
30 error command failed
31 error command sh -c npm run build && node build/__test__/notification-test.js
32 verbose exit 1
> 卢/streetmerchant/node_modules/messaging-api-telegram/dist/TelegramClient.js:67
> throw new axios_error_1.default(msg, err);
> ^
>
> AxiosError: Telegram API - 400 Bad Request: chat not found
> at TelegramClient.<anonymous> (/Users/sami/Documents/streetmerchant/node_modules/messaging-api-telegram/dist/TelegramClient.js:67:27)
> at Generator.throw (<anonymous>)
> at rejected (/Users/sami/Documents/streetmerchant/node_modules/messaging-api-telegram/dist/TelegramClient.js:6:65)
> at processTicksAndRejections (node:internal/process/task_queues:93:5) {
> config: {
> url: '/sendMessage',
> method: 'post',
> data: '{"chat_id":"234981291","text":"馃殌馃毃 [test:name] [test:brand (test:series)] test:model :: IN STOCK 馃毃馃殌\\nProduct Page: https://www.example.com/url\\nAdd To Cart Link: https://www.example.com/cartUrl"}',
> headers: {
> Accept: 'application/json, text/plain, */*',
> 'Content-Type': 'application/json',
> 'User-Agent': 'axios/0.19.2',
> 'Content-Length': 206
> },
> baseURL: 'https://api.telegram.org/bot**_ID-KEY_**/',
> transformRequest: [ [Function: transformRequest] ],
> transformResponse: [ [Function: transformResponse] ],
> timeout: 0,
> adapter: [Function: httpAdapter],
> xsrfCookieName: 'XSRF-TOKEN',
> xsrfHeaderName: 'X-XSRF-TOKEN',
> maxContentLength: -1,
> validateStatus: [Function: validateStatus]
> },
OS: MacOS BigSur
Looks like this is a telegram issue. Take a look here: https://forum.boltiot.com/t/telegram-project-error-bad-request-chat-not-found/13910/3
Thank you, i resole it :
-> Send a message to the group where your bot is .
-> https://api.telegram.org/botID/getUpdates
-> search for "chat":{"id"
-> copy and paste in the .env
I was using the wrong id for TELEGRAM_CHAT_ID=