Available methods

getChatMember()

Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a ChatMember object on success.

parameters

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

returns

ChatMember

usage in yaebal

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

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

await bot.api.getChatMember({
  chat_id: 123456789,
  user_id: 123456789,
} satisfies GetChatMemberParams);

context shortcut

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

context shortcut
/** Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Returns a [ChatMember](https://core.telegram.org/bots/api/#chatmember) object on success. */
ctx.getChatMember(params?: Omit<GetChatMemberParams, "chat_id" | "user_id"> & { user_id?: number })