A
A
ArtZor802021-03-28 19:04:37
Bots
ArtZor80, 2021-03-28 19:04:37

Telegram bot in php. Problem with deleting messages. How right?

Good day!!!

chat_id if you write to the bot in a personal message, the value is positive, if you write from the group, it is negative.

deletMessage ( 123123123, 123123 ) deletes messages fine, but not with a negative value.

How to solve this moment, tell me ...

ps . Some kind of nonsense ... Created a new group, chat_id is also a minus value - everything is perfectly deleted, but not in the desired group ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shurshur, 2021-03-30
@shurshur

It is necessary for the bot in the group settings to explicitly grant the rights to delete messages.

A
ArtZor80, 2021-04-01
@ArtZor80

I asked myself, I answer myself ....
An error crept into the field of the table where I entered the chat_id value - the property was INT (11), valid values ​​​​are not enough to record chat_id, it was not the actual chat_id that was recorded, but the boundary permissible value ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question