global fix and update bot Api
This commit is contained in:
@@ -741,6 +741,7 @@ export interface FamilyGroup {
|
||||
hasAvatar: boolean;
|
||||
members?: FamilyMember[];
|
||||
botFatherAvailable?: boolean;
|
||||
getMyIdBotAvailable?: boolean;
|
||||
}
|
||||
|
||||
export interface BotChatMessage {
|
||||
@@ -751,6 +752,8 @@ export interface BotChatMessage {
|
||||
messageId: number;
|
||||
createdAt: string;
|
||||
replyMarkupJson?: string | null;
|
||||
isPinned?: boolean;
|
||||
pinnedAt?: string | null;
|
||||
}
|
||||
|
||||
export interface BotChatMeta {
|
||||
@@ -817,6 +820,9 @@ export interface ChatMessage {
|
||||
createdAt: string;
|
||||
editedAt?: string;
|
||||
isDeleted?: boolean;
|
||||
isPinned?: boolean;
|
||||
pinnedAt?: string;
|
||||
pinnedById?: string;
|
||||
readByAll?: boolean;
|
||||
poll?: {
|
||||
id: string;
|
||||
@@ -887,14 +893,6 @@ export async function sendFamilyInvite(groupId: string, payload: { inviteeUserId
|
||||
return apiFetch<FamilyInvite>(`/family/groups/${groupId}/invites`, { method: 'POST', body: JSON.stringify(payload) }, token);
|
||||
}
|
||||
|
||||
export async function addBotFatherToFamily(groupId: string, token?: string | null) {
|
||||
return apiFetch<FamilyMember>(`/family/groups/${groupId}/botfather`, { method: 'POST', body: '{}' }, token);
|
||||
}
|
||||
|
||||
export async function addBotToFamily(groupId: string, botId: string, token?: string | null) {
|
||||
return apiFetch<FamilyMember>(`/family/groups/${groupId}/bots`, { method: 'POST', body: JSON.stringify({ botId }) }, token);
|
||||
}
|
||||
|
||||
export async function fetchBotChatMessages(botRef: string, token?: string | null) {
|
||||
return apiFetch<{
|
||||
messages?: BotChatMessage[];
|
||||
@@ -1137,6 +1135,13 @@ export async function toggleChatMessageReaction(messageId: string, emoji: string
|
||||
}, token);
|
||||
}
|
||||
|
||||
export async function setChatMessagePinned(messageId: string, pinned: boolean, token?: string | null) {
|
||||
return apiFetch<ChatMessage>(`/chat/messages/${messageId}/pin`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ pinned })
|
||||
}, token);
|
||||
}
|
||||
|
||||
export async function forwardChatMessages(targetRoomId: string, messageIds: string[], token?: string | null) {
|
||||
return apiFetch<{ messages?: ChatMessage[] }>(`/chat/rooms/${targetRoomId}/forward`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user