getChatAdministrators()
Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects.
parameters
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | string | required | Unique identifier for the target chat or username of the target supergroup or channel in the format @username |
return_bots | boolean | optional | Pass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted. |
returns
usage in yaebal
getChatAdministrators is directly typed on Api — call it straight off bot.api.
import type { GetChatAdministratorsParams } from "@yaebal/types";
await bot.api.getChatAdministrators({
chat_id: 123456789,
} satisfies GetChatAdministratorsParams);context shortcut
also available as ctx.getChatAdministrators() on
17
context types — see @yaebal/contexts.
/** Use this method to get a list of administrators in a chat. Returns an Array of [ChatMember](https://core.telegram.org/bots/api/#chatmember) objects. */
ctx.getChatAdministrators(params: Omit<GetChatAdministratorsParams, "chat_id">)official Bot API docs: https://core.telegram.org/bots/api/#getchatadministrators