we dev on prod in here boys
This commit is contained in:
parent
79bf78252f
commit
23db1d5c88
2 changed files with 15 additions and 16 deletions
|
@ -1,15 +1,22 @@
|
|||
<script lang="ts">
|
||||
import { authorize, setActivity } from "./lib/discord";
|
||||
import { authorize, discordSdk } from "./lib/discord";
|
||||
|
||||
let output = "";
|
||||
|
||||
async function main() {
|
||||
const auth = await authorize();
|
||||
output += `auth: ${JSON.stringify(auth)}\n`;
|
||||
output = output + `auth: ${JSON.stringify(auth)}\n`;
|
||||
if (!auth) return (output += `failed to authenticate :'c`);
|
||||
|
||||
const activity = await setActivity();
|
||||
output += `activity: ${JSON.stringify(activity)}\n`;
|
||||
const activity = await discordSdk.commands.setActivity({
|
||||
activity: {
|
||||
type: 0,
|
||||
details: "garf",
|
||||
state: "Playing",
|
||||
},
|
||||
});
|
||||
|
||||
output = output + `activity: ${JSON.stringify(activity)}\n`;
|
||||
}
|
||||
|
||||
main();
|
||||
|
@ -17,5 +24,7 @@
|
|||
|
||||
<main>
|
||||
<p>garf 2: eletric boogaloo</p>
|
||||
{#key output}
|
||||
<tt>{output}</tt>
|
||||
{/key}
|
||||
</main>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
const CLIENT_ID = "869016244613951539";
|
||||
|
||||
import { DiscordSDK } from "@discord/embedded-app-sdk";
|
||||
const discordSdk = new DiscordSDK(CLIENT_ID);
|
||||
export const discordSdk = new DiscordSDK(CLIENT_ID);
|
||||
|
||||
export async function authorize() {
|
||||
await discordSdk.ready();
|
||||
|
@ -30,13 +30,3 @@ export async function authorize() {
|
|||
|
||||
return auth;
|
||||
}
|
||||
|
||||
export async function setActivity() {
|
||||
return await discordSdk.commands.setActivity({
|
||||
activity: {
|
||||
type: 0,
|
||||
details: "garf",
|
||||
state: "Playing",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue