augustjune/canoe

`.delete` method on user message not allowed

oskin1 opened this issue · 2 comments

.delete method illustrated in exaples seems to be disallowed by Telegram API

_ <- Scenario.eval(passwordMessage.delete)

Application fails with the following error:
org.http4s.client.UnexpectedStatus: unexpected HTTP status: 405 Method Not Allowed

Hi
MessageApi#delete method does delete the message, but it has several restrictions that should be met for the method to succeed. You can find them in the documentation for the method.

* There are limitations what message can be deleted:
* - A message can only be deleted if it was sent less than 48 hours ago.
* - Bots can delete outgoing messages in private chats, groups, and supergroups.
* - Bots can delete incoming messages in private chats.
* - Bots granted can_post_messages permissions can delete outgoing messages in channels.
* - If the bot is an administrator of a group, it can delete any message there.
* - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

Make sure these limitations are satisfied in your use case.

@augustjune, thank you!