Available methods

setChatMemberTag()

Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right. 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
tagstringoptionalNew tag for the member; 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 { SetChatMemberTagParams } from "@yaebal/types";

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

context shortcut

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

context shortcut
/** Use this method to set a tag for a regular member in a group or a supergroup. The bot must be an administrator in the chat for this to work and must have the *can\_manage\_tags* administrator right. Returns *True* on success. */
ctx.setChatMemberTag(params: Omit<SetChatMemberTagParams, "chat_id" | "user_id">)