Skip to main content

Change chat picture

Changes the chat avatar picture

Function ChangeChatPicture(Val Token, Val ChatID, Val File) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringBot token
ChatID--chatidString, NumberChat ID
File--fileBinaryData, StringImage file

Returns: Map Of KeyAndValue - serialized JSON response from VK Teams


tip

Method at API documentation: POST ​/chats​/avatar​/set

Parameters with Binary data type can also accept file paths on disk and URLs


1C:Enterprise/OneScript code example
    Token  = "001.3501506236.091...";
ChatID = "AoLI0egLWBSLR1Ngn2w";

File = "https://api.athenaeum.digital/test_data/spy2.png"; // URL
FilePath = GetTempFileName("png"); // Path

CopyFile(File, FilePath);

FileBD = New BinaryData(FilePath); // Binary

Result = OPI_VKTeams.ChangeChatPicture(Token, ChatID, File);

Result = OPI_VKTeams.ChangeChatPicture(Token, ChatID, FilePath);

Result = OPI_VKTeams.ChangeChatPicture(Token, ChatID, FileBD);
    oint vkteams ChangeChatPicture \
--token "***" \
--chatid "AoLI0egLWBSLR1Ngn2w" \
--file "C:\Users\Administrator\AppData\Local\Temp\5hqt5zhh1ge.png"
Result
{
"ok": true
}