summaryrefslogtreecommitdiff
path: root/priv/static/discord_activity.js
blob: 344c30ddbe11d42db96ad3819d04a825e0031342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);
  });