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

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

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

await bot.api.call<ChatMember>("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">)