feat: add discord rich presence editor window and interactive embed preview
This commit is contained in:
1 parent
e3abea8d83
commit
386c829455
30 files changed
+4102
-263
No files matched your search
+25
-2
@@ -1,7 +1,29 @@
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
|
||||
export type PresenceButtonPayload = {
|
||||
label: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
export type PresenceActivityPayload = {
|
||||
state?: string;
|
||||
details?: string;
|
||||
largeImageKey?: string;
|
||||
largeImageText?: string;
|
||||
smallImageKey?: string | null;
|
||||
smallImageText?: string | null;
|
||||
button1?: PresenceButtonPayload | null;
|
||||
button2?: PresenceButtonPayload | null;
|
||||
showTimestamp?: boolean;
|
||||
};
|
||||
|
||||
export const connect = async () => await invoke('presence_connect');
|
||||
export const disconnect = async () => await invoke('presence_disconnect');
|
||||
export const isConnected = async () => await invoke<boolean>('presence_is_connected');
|
||||
|
||||
export const updateActivity = async (activity: PresenceActivityPayload) =>
|
||||
await invoke('presence_update_activity', { activity });
|
||||
|
||||
export const updateStatus = async (status: {
|
||||
state: string;
|
||||
details: string;
|
||||
@@ -14,8 +36,9 @@ export const updateStatus = async (status: {
|
||||
largeImageKey: status.largeImageKey,
|
||||
},
|
||||
});
|
||||
|
||||
export const updateUser = async (user: { username: string; id?: string | null }) =>
|
||||
await invoke('presence_update_user', { user: { username: user.username, id: user.id } });
|
||||
|
||||
export const updateButton = async (button: { text?: string; url?: string }) =>
|
||||
await invoke('presence_update_button', { button: button });
|
||||
export const isConnected = async () => await invoke<boolean>('presence_is_connected');
|
||||
await invoke('presence_update_button', { button });
|
||||
Reference in new issue
Block a user