Struct teloxide::payloads::SetChatPhoto
source · [−]Expand description
Use this method to set a new profile photo for the chat. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
Fields
chat_id: RecipientUnique identifier for the target chat or username of the target channel (in the format @channelusername)
photo: InputFileNew chat photo, uploaded using multipart/form-data
Implementations
sourceimpl SetChatPhoto
impl SetChatPhoto
pub fn new(chat_id: impl Into<Recipient>, photo: InputFile) -> SetChatPhotoⓘNotable traits for SetChatPhotoimpl Payload for SetChatPhoto type Output = True;
Trait Implementations
sourceimpl Clone for SetChatPhoto
impl Clone for SetChatPhoto
sourcefn clone(&self) -> SetChatPhotoⓘNotable traits for SetChatPhotoimpl Payload for SetChatPhoto type Output = True;
fn clone(&self) -> SetChatPhotoⓘNotable traits for SetChatPhotoimpl Payload for SetChatPhoto type Output = True;
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for SetChatPhoto
impl Debug for SetChatPhoto
sourceimpl MultipartPayload for SetChatPhoto
impl MultipartPayload for SetChatPhoto
fn copy_files(&self, into: &mut dyn FnMut(InputFile))
fn move_files(&mut self, into: &mut dyn FnMut(InputFile))
sourceimpl Payload for SetChatPhoto
impl Payload for SetChatPhoto
sourcefn timeout_hint(&self) -> Option<Duration>
fn timeout_hint(&self) -> Option<Duration>
If this payload may take long time to execute (e.g.
GetUpdates with
big timeout), the minimum timeout that should be used. Read moresourceimpl Serialize for SetChatPhoto
impl Serialize for SetChatPhoto
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl !RefUnwindSafe for SetChatPhoto
impl Send for SetChatPhoto
impl Sync for SetChatPhoto
impl Unpin for SetChatPhoto
impl !UnwindSafe for SetChatPhoto
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Erasable for T
impl<T> Erasable for T
sourceimpl<P> HasPayload for Pwhere
P: Payload,
impl<P> HasPayload for Pwhere
P: Payload,
type Payload = P
type Payload = P
The type of the payload contained.
sourcefn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
fn payload_mut(&mut self) -> &mut <P as HasPayload>::Payload
Gain mutable access to the underlying payload.
sourcefn payload_ref(&self) -> &<P as HasPayload>::Payload
fn payload_ref(&self) -> &<P as HasPayload>::Payload
Gain immutable access to the underlying payload.
sourcefn with_payload_mut<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self::Payload),
fn with_payload_mut<F>(self, f: F) -> Selfwhere
F: FnOnce(&mut Self::Payload),
Update payload with a function