Available methods

approveChatJoinRequest()

Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

parameters

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

returns

boolean

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

await bot.api.call<boolean>("approveChatJoinRequest", {
  chat_id: 123456789,
  user_id: 123456789,
} satisfies ApproveChatJoinRequestParams);

context shortcut

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

context shortcut
/** Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the *can\_invite\_users* administrator right. Returns *True* on success. */
ctx.approveChatJoinRequest(params?: Omit<ApproveChatJoinRequestParams, "chat_id" | "user_id">)