summaryrefslogtreecommitdiff
path: root/priv/static/discord_activity.js
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-07-26 14:20:14 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-07-26 14:23:53 +0000
commitcd794243a5bba358d995e26ba024268e7d5d3f85 (patch)
tree2df6974cc40f736441f7b985ca95a7f897f4510e /priv/static/discord_activity.js
parent37ab5213a368926506206cb21a438cb7fea3d530 (diff)
downloadmediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar
mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar.gz
mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.zip
Add Discord Activity functionality (mostly) + general improvements
Diffstat (limited to 'priv/static/discord_activity.js')
-rw-r--r--priv/static/discord_activity.js20
1 files changed, 20 insertions, 0 deletions
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);
+ });