Add the use_independent_chat_permissions field to RestrictChatMember and SetChatPermissions

This commit is contained in:
TheAwiteb 2023-10-05 00:32:47 +03:00 committed by Awiteb
parent e3b2277fdf
commit 3e05086d47
No known key found for this signature in database
GPG key ID: 16C8AD0B49C39C88
3 changed files with 16 additions and 0 deletions

View file

@ -1988,6 +1988,11 @@ Schema(
ty: RawTy("ChatPermissions"), ty: RawTy("ChatPermissions"),
descr: Doc(md: "A JSON-serialized object for new user permissions") descr: Doc(md: "A JSON-serialized object for new user permissions")
), ),
Param(
name: "use_independent_chat_permissions",
ty: Option(bool),
descr: Doc(md: "Pass _True_ if chat permissions are set independently. Otherwise, the _can\\_send\\_other\\_messages_ and _can\\_add\\_web\\_page\\_previews_ permissions will imply the _can\\_send\\_messages_, _can\\_send\\_audios_, _can\\_send\\_documents_, _can\\_send\\_photos_, _can\\_send\\_videos_, _can\\_send\\_video\\_notes_, and _can\\_send\\_voice\\_notes_ permissions; the _can\\_send\\_polls_ permission will imply the _can\\_send\\_messages_ permission.")
),
Param( Param(
name: "until_date", name: "until_date",
ty: Option(u64), ty: Option(u64),
@ -2153,6 +2158,11 @@ Schema(
ty: RawTy("ChatPermissions"), ty: RawTy("ChatPermissions"),
descr: Doc(md: "New default chat permissions") descr: Doc(md: "New default chat permissions")
), ),
Param(
name: "use_independent_chat_permissions",
ty: Option(bool),
descr: Doc(md: "Pass _True_ if chat permissions are set independently. Otherwise, the _can\\_send\\_other\\_messages_ and _can\\_add\\_web\\_page\\_previews_ permissions will imply the _can\\_send\\_messages_, _can\\_send\\_audios_, _can\\_send\\_documents_, _can\\_send\\_photos_, _can\\_send\\_videos_, _can\\_send\\_video\\_notes_, and _can\\_send\\_voice\\_notes_ permissions; the _can\\_send\\_polls_ permission will imply the _can\\_send\\_messages_ permission.")
),
], ],
), ),
Method( Method(

View file

@ -18,6 +18,8 @@ impl_payload! {
pub permissions: ChatPermissions, pub permissions: ChatPermissions,
} }
optional { optional {
/// Pass _True_ if chat permissions are set independently. Otherwise, the _can\_send\_other\_messages_ and _can\_add\_web\_page\_previews_ permissions will imply the _can\_send\_messages_, _can\_send\_audios_, _can\_send\_documents_, _can\_send\_photos_, _can\_send\_videos_, _can\_send\_video\_notes_, and _can\_send\_voice\_notes_ permissions; the _can\_send\_polls_ permission will imply the _can\_send\_messages_ permission.
pub use_independent_chat_permissions: bool,
/// Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever /// Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
#[serde(with = "crate::types::serde_opt_date_from_unix_timestamp")] #[serde(with = "crate::types::serde_opt_date_from_unix_timestamp")]
pub until_date: DateTime<Utc> [into], pub until_date: DateTime<Utc> [into],

View file

@ -14,5 +14,9 @@ impl_payload! {
/// New default chat permissions /// New default chat permissions
pub permissions: ChatPermissions, pub permissions: ChatPermissions,
} }
optional {
/// Pass _True_ if chat permissions are set independently. Otherwise, the _can\_send\_other\_messages_ and _can\_add\_web\_page\_previews_ permissions will imply the _can\_send\_messages_, _can\_send\_audios_, _can\_send\_documents_, _can\_send\_photos_, _can\_send\_videos_, _can\_send\_video\_notes_, and _can\_send\_voice\_notes_ permissions; the _can\_send\_polls_ permission will imply the _can\_send\_messages_ permission.
pub use_independent_chat_permissions: bool,
}
} }
} }