B
B
Bogdan2018-05-17 19:47:12
Ruby on Rails
Bogdan, 2018-05-17 19:47:12

Delete the previous message in the channel and not output bot commands?

Hello,
1) how to delete the previous message clearly? And everything works

def open(*)
     bot.delete_message(chat_id: payload['chat']['id'], message_id: payload['message_id']-1 )
  end

If we take the situation when, for example, Message 1 was written, then Message 2, which was deleted. In fact, now there is Message 1 and it needs to be deleted. Now, in fact, Message number 1 is already payload['message_id']-2. How can this situation be resolved?
2) How to disable bot commands in the general chat?
5afdb20281223757742508.png
Thanks

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question