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">
|
<script lang="ts">
|
||||||
import { authorize, setActivity } from "./lib/discord";
|
import { authorize, discordSdk } from "./lib/discord";
|
||||||
|
|
||||||
let output = "";
|
let output = "";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const auth = await authorize();
|
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`);
|
if (!auth) return (output += `failed to authenticate :'c`);
|
||||||
|
|
||||||
const activity = await setActivity();
|
const activity = await discordSdk.commands.setActivity({
|
||||||
output += `activity: ${JSON.stringify(activity)}\n`;
|
activity: {
|
||||||
|
type: 0,
|
||||||
|
details: "garf",
|
||||||
|
state: "Playing",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
output = output + `activity: ${JSON.stringify(activity)}\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
@ -17,5 +24,7 @@
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<p>garf 2: eletric boogaloo</p>
|
<p>garf 2: eletric boogaloo</p>
|
||||||
<tt>{output}</tt>
|
{#key output}
|
||||||
|
<tt>{output}</tt>
|
||||||
|
{/key}
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const CLIENT_ID = "869016244613951539";
|
const CLIENT_ID = "869016244613951539";
|
||||||
|
|
||||||
import { DiscordSDK } from "@discord/embedded-app-sdk";
|
import { DiscordSDK } from "@discord/embedded-app-sdk";
|
||||||
const discordSdk = new DiscordSDK(CLIENT_ID);
|
export const discordSdk = new DiscordSDK(CLIENT_ID);
|
||||||
|
|
||||||
export async function authorize() {
|
export async function authorize() {
|
||||||
await discordSdk.ready();
|
await discordSdk.ready();
|
||||||
|
@ -30,13 +30,3 @@ export async function authorize() {
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setActivity() {
|
|
||||||
return await discordSdk.commands.setActivity({
|
|
||||||
activity: {
|
|
||||||
type: 0,
|
|
||||||
details: "garf",
|
|
||||||
state: "Playing",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue