Available methods

getChatAdministrators()

Use this method to get a list of administrators in a chat. Returns an Array of ChatMember objects.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target supergroup or channel in the format @username
return_botsbooleanoptionalPass True to additionally receive all bots that are administrators of the chat. By default, bots other than the current bot are omitted.

returns

ChatMember[]

usage in yaebal

getChatAdministrators is directly typed on Api — call it straight off bot.api.

bot.ts
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.

context shortcut
/** 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">)