Available methods

setChatAdministratorCustomTitle()

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target supergroup in the format @username
user_idnumberrequiredUnique identifier of the target user
custom_titlestringrequiredNew custom title for the administrator; 0-16 characters, emoji are not allowed

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

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

context shortcut

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

context shortcut
/** Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns *True* on success. */
ctx.setChatAdministratorCustomTitle(params: Omit<SetChatAdministratorCustomTitleParams, "chat_id" | "user_id">)