1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/VKTeams/Chat-management/Change-chat-picture.mdx
T
Vitaly the Alpaca (bot) 2e809b51b0 Main build (Jenkins)
2024-11-17 16:09:58 +03:00

79 lines
1.9 KiB
Plaintext

---
sidebar_position: 2
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Change chat picture
Changes the chat avatar picture
`Function ChangeChatPicture(Val Token, Val ChatID, Val File) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Bot token |
| ChatID | --chatid | String, Number | ✔ | Chat ID |
| File | --file | BinaryData, String | ✔ | Image file |
Returns: Map Of KeyAndValue - serialized JSON response from VK Teams
<br/>
:::tip
Method at API documentation: [POST ​/chats​/avatar​/set](https://teams.vk.com/botapi/#/chats/post_chats_avatar_set)<br/>
Parameters with Binary data type can also accept file paths on disk and URLs
:::
<br/>
```bsl title="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);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint vkteams ChangeChatPicture \
--token "***" \
--chatid "AoLI0egLWBSLR1Ngn2w" \
--file "C:\Users\Administrator\AppData\Local\Temp\jlowywta1vb.png"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint vkteams ChangeChatPicture ^
--token "***" ^
--chatid "AoLI0egLWBSLR1Ngn2w" ^
--file "C:\Users\Administrator\AppData\Local\Temp\jlowywta1vb.png"
```
</TabItem>
</Tabs>
```json title="Result"
{
"ok": true
}
```