Available methods

setChatPhoto()

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

parameters

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target channel in the format @username
photoInputFilerequiredNew chat photo, uploaded using multipart/form-data

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 { media } from "@yaebal/core";
import type { SetChatPhotoParams } from "@yaebal/types";

await bot.api.call<boolean>("setChatPhoto", {
  chat_id: 123456789,
  photo: {} /* InputFile */,
} satisfies SetChatPhotoParams);

context shortcut

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

context shortcut
/** Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns *True* on success. */
ctx.setChatPhoto(params: Omit<SetChatPhotoParams, "chat_id">)