Node-telegram-bot-api: How to remove message ?

Created on 10 Jun 2016  路  6Comments  路  Source: yagop/node-telegram-bot-api

I want to create authorization functional for user by password and password must be hidden from chat.
I needs to remove message from chat.
How to realize this functional?

Thx

Most helpful comment

Switch to private message, get password there.

All 6 comments

Deleting messages is not possible. You could edit them instead to display _Success_ or something similar.

I can to edit user message? For example, change characters like *?

maybe send the password via inline?

so "@yourbotname (type password)"

Oh, sorry. Deleting another users messages is not possible. You could however use inline mode, like paOol just mentioned, or simply tell them to delete their message. Or use an auth service via link, but that might be overkill..

Switch to private message, get password there.

So:

  1. It is not possible to delete any message, mostly another user's. You may want to request the feature.
  2. It is not possible to edit another user's message. The bot can only edit messages itself sent. See Updating Messages for more information.

Therefore, you may:

  1. Process such authorization requests in private messages i.e. msg.chat.type === "private". See Telegram.Chat.
  2. Advise the user to edit or delete the message containing the password afterwards.

Hope that helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rezania815 picture Rezania815  路  3Comments

Lemmmy picture Lemmmy  路  3Comments

mbrammer picture mbrammer  路  3Comments

FerX picture FerX  路  4Comments

Panthro picture Panthro  路  3Comments