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
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | string | required | Unique identifier for the target chat or username of the target channel in the format @username |
photo | InputFile | required | New 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.
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.
/** 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">)official Bot API docs: https://core.telegram.org/bots/api/#setchatphoto