Maybe? Can't build

This commit is contained in:
3top1a
2024-10-16 20:37:47 +02:00
parent 6e59d59a1d
commit 1a0c15e17f
5 changed files with 60 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import { Client, Presence } from "discord-rpc";
import * as DRPC from "discord-rpc";
import { app, ipcMain } from "electron";
import { globalEvents } from "../constants/globalEvents";
import { settings } from "../constants/settings";
@@ -10,7 +10,7 @@ import { settingsStore } from "./settings";
const clientId = "833617820704440341";
export let rpc: Client;
export let rpc: DRPC.Client;
const observer = () => {
if (rpc) {
@@ -33,8 +33,10 @@ const updateActivity = () => {
}
};
const getActivity = (): Presence => {
const presence: Presence = { ...defaultPresence };
const getActivity = (): DRPC.Presence => {
const presence: DRPC.Presence = { ...defaultPresence };
presence.type = DRPC.ActivityTypes.LISTENING
if (mediaInfo.status === MediaStatus.paused) {
presence.details =
@@ -110,7 +112,7 @@ const getActivity = (): Presence => {
* Set up the discord rpc and listen on globalEvents.updateInfo
*/
export const initRPC = () => {
rpc = new Client({ transport: "ipc" });
rpc = new DRPC.Client({ transport: "ipc" });
rpc.login({ clientId }).then(
() => {
rpc.on("ready", () => {