diff options
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); + }); |