Available methods

getChatMemberCount()

Use this method to get the number of members in a chat. Returns Int on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target supergroup or channel in the format @username

returns

number

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 { GetChatMemberCountParams } from "@yaebal/types";

await bot.api.call<number>("getChatMemberCount", {
  chat_id: 123456789,
} satisfies GetChatMemberCountParams);

context shortcut

also available as ctx.getChatMemberCount() on 16 context types — see @yaebal/contexts.

context shortcut
/** Use this method to get the number of members in a chat. Returns *Int* on success. */
ctx.getChatMemberCount(params?: Omit<GetChatMemberCountParams, "chat_id">)