Skip to content

Commit

Permalink
fix: remove discord-rpc and update electron
Browse files Browse the repository at this point in the history
  • Loading branch information
d0kur0 committed Jan 25, 2024
1 parent 13e196b commit 693580b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 104 deletions.
27 changes: 1 addition & 26 deletions electron/events/discord.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
const { ipcMain } = require("electron");
const { register, Client } = require("discord-rpc");

try {
const clientId = "1166773524380274788";
register(clientId);

const rpc = new Client({ transport: "ipc" });
rpc.login({ clientId }).catch(() => {});
} catch (e) {
// Поебать
}

ipcMain.on("discord/changeActivity", (event, file) => {
queueMicrotask(async () => {
try {
await rpc.setActivity({
state: file.name,
details: `/${file.rootThread.board} - ${file.rootThread.subject}`.slice(0, 127),
buttons: [{ label: "Get source", url: file.url }],
largeImageKey: file.previewUrl,
smallImageKey: file.previewUrl,
largeImageText: file.name,
smallImageText: file.name,
});
} catch (e) {
// Поебать
}
});
console.log("not implemented", event, file);
});
94 changes: 18 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@solidjs/router": "^0.8.3",
"@stitches/core": "^1.2.8",
"bricks.js": "^1.8.0",
"discord-rpc": "^4.0.1",
"electron-squirrel-startup": "^1.0.0",
"nanostores": "^0.9.3",
"solid-icons": "^1.0.12",
Expand All @@ -51,7 +50,7 @@
"@typescript-eslint/parser": "^6.7.3",
"concurrently": "^8.2.1",
"cross-env": "^7.0.3",
"electron": "26.2.2",
"electron": "^28.2.0",
"eslint": "^8.50.0",
"eslint-plugin-solid": "^0.13.0",
"eslint-plugin-unused-imports": "^3.0.0",
Expand Down

0 comments on commit 693580b

Please sign in to comment.