rutebot/requests/delete_chat_photo.rs
1use serde::Serialize;
2
3use crate::requests::{ChatId, Request};
4
5/// Use this struct to delete a chat photo. Photos can't be changed for private chats.
6/// The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
7/// Returns `True` on success.
8#[derive(Serialize, Debug, Clone)]
9pub struct DeleteChatPhoto<'a> {
10 /// Unique identifier for the target group or username of the target supergroup or channel
11 pub chat_id: ChatId<'a>,
12}
13
14impl<'a> Request for DeleteChatPhoto<'a> {
15 type ResponseType = bool;
16
17 fn method(&self) -> &'static str {
18 "deleteChatPhoto"
19 }
20}
21
22impl<'a> DeleteChatPhoto<'a> {
23 pub fn new(chat_id: impl Into<ChatId<'a>>) -> Self {
24 Self {
25 chat_id: chat_id.into(),
26 }
27 }
28}