Dzhakhar Ukhaev
Dzhakhar Ukhaev

Reputation: 305

Why do I get the following error when I try to edit message in group: ETELEGRAM: 400 Bad Request: message to edit not found?

Edit functionality works properly in private chat, but doesn't work in group chat. What might be the reason of that behaviour?

I am getting the following error:

Unhandled rejection Error: ETELEGRAM: 400 Bad Request: message to edit not found
    at project\node_modules\node-telegram-bot-api\src\telegram.js:291:15
    at tryCatcher (project\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (project\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (project\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (project\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (project\node_modules\bluebird\js\release\promise.js:729:18)
    at _drainQueueStep (project\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (project\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (project\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (project\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:464:21)

There's no need to see my code because as I said before it works fine in private chat. So there might be some group-specific thing that I am now aware of. Maybe I have to configure group or the bot.

Message ID is 100% correct. Message belongs to the bot. Bot has access to the group messages. Message is not expired.

Thank you!

Upvotes: 1

Views: 1349

Answers (1)

Tafa
Tafa

Reputation: 45

When you intent to send message to GROUPs the ID must come with a - like with you chatid on group is 789456789 the id will be -789456789

Upvotes: 1

Related Questions