forked from mtusi2026/mtusi2026lab4
лаба 4 на оценку 5
This commit is contained in:
@@ -143,7 +143,12 @@ export const api = {
|
||||
);
|
||||
},
|
||||
|
||||
sendMessage(chatID: string, text: string, idempotencyKey: string): Promise<Message> {
|
||||
sendMessage(
|
||||
chatID: string,
|
||||
text: string,
|
||||
idempotencyKey: string,
|
||||
attachmentIDs: string[] = [],
|
||||
): Promise<Message> {
|
||||
return request<Message>(
|
||||
`${browserApi}/chats/${encodeURIComponent(chatID)}/messages`,
|
||||
{
|
||||
@@ -151,7 +156,7 @@ export const api = {
|
||||
headers: {
|
||||
"Idempotency-Key": idempotencyKey,
|
||||
},
|
||||
body: { text },
|
||||
body: { text, attachment_ids: attachmentIDs },
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@ export type Message = {
|
||||
chat_id: string;
|
||||
sender_id: string;
|
||||
text: string;
|
||||
attachment_ids: string[];
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user