teloxide_core/payloads/create_chat_invite_link.rs
1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use chrono::{DateTime, Utc};
4use serde::Serialize;
5
6use crate::types::{ChatInviteLink, Recipient};
7
8impl_payload! {
9 /// Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. The link can be revoked using the method [`RevokeChatInviteLink`]. Returns the new invite link as [`ChatInviteLink`] object.
10 ///
11 /// [`ChatInviteLink`]: crate::types::ChatInviteLink
12 /// [`RevokeChatInviteLink`]: crate::payloads::RevokeChatInviteLink
13 #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
14 pub CreateChatInviteLink (CreateChatInviteLinkSetters) => ChatInviteLink {
15 required {
16 /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
17 pub chat_id: Recipient [into],
18 }
19 optional {
20 /// Invite link name; 0-32 characters
21 pub name: String [into],
22 /// Point in time (Unix timestamp) when the link will expire
23 #[serde(with = "crate::types::serde_opt_date_from_unix_timestamp")]
24 pub expire_date: DateTime<Utc> [into],
25 /// Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
26 pub member_limit: u32,
27 /// True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
28 pub creates_join_request: bool,
29 }
30 }
31}