Skip to main content

ronami_core/payloads/
delete_message.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::MessageId;
6use crate::types::Recipient;
7use crate::types::True;
8
9impl_payload! {
10    /// Use this method to delete a message, including service messages, with the following limitations:
11    /// - A message can only be deleted if it was sent less than 48 hours ago.
12    /// - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
13    /// - Bots can delete outgoing messages in private chats, groups, and supergroups.
14    /// - Bots can delete incoming messages in private chats.
15    /// - Bots granted can_post_messages permissions can delete outgoing messages in channels.
16    /// - If the bot is an administrator of a group, it can delete any message there.
17    /// - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
18    ///
19    /// Returns True on success.
20    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
21    pub DeleteMessage (DeleteMessageSetters) => True {
22        required {
23            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`).
24            pub chat_id: Recipient [into],
25            /// Identifier of the message to delete
26            #[serde(flatten)]
27            pub message_id: MessageId,
28        }
29    }
30}