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