diff --git a/src/context.ts b/src/context.ts index 24b06931..bc2d8b0a 100644 --- a/src/context.ts +++ b/src/context.ts @@ -1760,14 +1760,20 @@ export class Context implements RenamedUpdate { * Context-aware alias for `api.setChatPermissions`. Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. * * @param permissions New default chat permissions + * @param other Optional remaining parameters, confer the official reference below * @param signal Optional `AbortSignal` to cancel the request * * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions */ - setChatPermissions(permissions: ChatPermissions, signal?: AbortSignal) { + setChatPermissions( + permissions: ChatPermissions, + other?: Other<"setChatPermissions", "chat_id" | "permissions">, + signal?: AbortSignal, + ) { return this.api.setChatPermissions( orThrow(this.chatId, "setChatPermissions"), permissions, + other, signal, ); } diff --git a/src/core/api.ts b/src/core/api.ts index a639b2f9..0bf45511 100644 --- a/src/core/api.ts +++ b/src/core/api.ts @@ -1043,6 +1043,7 @@ export class Api { * * @param chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) * @param permissions New default chat permissions + * @param other Optional remaining parameters, confer the official reference below * @param signal Optional `AbortSignal` to cancel the request * * **Official reference:** https://core.telegram.org/bots/api#setchatpermissions @@ -1050,9 +1051,13 @@ export class Api { setChatPermissions( chat_id: number | string, permissions: ChatPermissions, + other?: Other, signal?: AbortSignal, ) { - return this.raw.setChatPermissions({ chat_id, permissions }, signal); + return this.raw.setChatPermissions( + { chat_id, permissions, ...other }, + signal, + ); } /**