Available methods

getChatMemberCount()

Use this method to get the number of members in a chat. Returns Integer 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

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

bot.ts
import type { GetChatMemberCountParams } from "@yaebal/types";

await bot.api.getChatMemberCount({
  chat_id: 123456789,
} satisfies GetChatMemberCountParams);

context shortcut

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

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