we dev on prod in here boys
This commit is contained in:
parent
404c4af435
commit
9cf24faaaf
2 changed files with 8 additions and 9 deletions
|
@ -1,12 +1,15 @@
|
|||
<script lang="ts">
|
||||
import { authorize, setActivity } from "./lib/discord";
|
||||
|
||||
let output = {};
|
||||
let output = "";
|
||||
|
||||
authorize().then(async (auth) => {
|
||||
// we now have our authenticated context.
|
||||
output = await setActivity();
|
||||
});
|
||||
async function main() {
|
||||
const result = await authorize();
|
||||
|
||||
output += `result: ${JSON.stringify(result)}\n`;
|
||||
}
|
||||
|
||||
main();
|
||||
</script>
|
||||
|
||||
<main>
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
const CLIENT_ID = "869016244613951539";
|
||||
|
||||
import { DiscordSDK } from "@discord/embedded-app-sdk";
|
||||
import { writable } from "svelte/store";
|
||||
const discordSdk = new DiscordSDK(CLIENT_ID);
|
||||
|
||||
export let information = writable();
|
||||
|
||||
export async function authorize() {
|
||||
const { code } = await discordSdk.commands.authorize({
|
||||
client_id: CLIENT_ID,
|
||||
|
@ -28,7 +25,6 @@ export async function authorize() {
|
|||
const { access_token } = await response.json();
|
||||
|
||||
const auth = await discordSdk.commands.authenticate({ access_token });
|
||||
information.set(auth);
|
||||
|
||||
return auth;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue