diff options
author | Arjun Satarkar <me@arjunsatarkar.net> | 2024-07-26 14:20:14 +0000 |
---|---|---|
committer | Arjun Satarkar <me@arjunsatarkar.net> | 2024-07-26 14:23:53 +0000 |
commit | cd794243a5bba358d995e26ba024268e7d5d3f85 (patch) | |
tree | 2df6974cc40f736441f7b985ca95a7f897f4510e /priv/static/discord_activity.js | |
parent | 37ab5213a368926506206cb21a438cb7fea3d530 (diff) | |
download | mediasync-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.js | 20 |
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); + }); |