From cd794243a5bba358d995e26ba024268e7d5d3f85 Mon Sep 17 00:00:00 2001 From: Arjun Satarkar Date: Fri, 26 Jul 2024 19:50:14 +0530 Subject: Add Discord Activity functionality (mostly) + general improvements --- priv/static/discord_activity.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 priv/static/discord_activity.js (limited to 'priv/static/discord_activity.js') diff --git a/priv/static/discord_activity.js b/priv/static/discord_activity.js new file mode 100644 index 0000000..344c30d --- /dev/null +++ b/priv/static/discord_activity.js @@ -0,0 +1,20 @@ +import { DiscordSDK } from "/static/discord-embedded-app-sdk/Discord.js"; + +const discordSdk = new DiscordSDK(DISCORD_CLIENT_ID); + +discordSdk + .ready() + .then(() => { + console.log("Mediasync: Discord SDK ready."); + return discordSdk.commands.authorize({ + client_id: DISCORD_CLIENT_ID, + response_type: "code", + state: "", + prompt: "none", + scope: ["identify"], + }); + }) + .then((result) => { + const { code } = result; + console.log(code); + }); -- cgit v1.2.3-57-g22cb