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

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
import type { ChatMember, GetChatAdministratorsParams } from "@yaebal/types";

await bot.api.call<ChatMember[]>("getChatAdministrators", {
  chat_id: 123456789,
} satisfies GetChatAdministratorsParams);

context shortcut

also available as ctx.getChatAdministrators() on 16 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">)