This commit is contained in:
cirroskais 2024-03-18 16:24:59 -04:00
parent cefb2fced8
commit 63cbe16d5a
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D

View file

@ -1,12 +1,12 @@
<script lang="ts"> <script lang="ts">
import { authorize, discordSdk } from "./lib/discord"; import { authorize, discordSdk } from "./lib/discord";
let output = ""; let logs = [{ type: "Init", content: "Begin logs" }];
async function main() { async function main() {
const auth = await authorize().catch((e) => e); const auth = await authorize().catch((e) => e);
output = output + `auth: ${JSON.stringify(auth)}\n`; if (!auth) return logs.push({ type: "Auth", content: `Failure | ${JSON.stringify(auth)}` });
if (!auth) return (output += `failed to authenticate :'c`); logs.push({ type: "Auth", content: JSON.stringify(auth) });
const response = await discordSdk.commands.setActivity({ const response = await discordSdk.commands.setActivity({
activity: { activity: {
@ -19,7 +19,7 @@
}, },
}); });
output = output + `response: ${JSON.stringify(response)}\n`; logs.push({ type: "Activity", content: JSON.stringify(response) });
} }
main(); main();
@ -27,7 +27,9 @@
<main> <main>
<p>garf 2: eletric boogaloo</p> <p>garf 2: eletric boogaloo</p>
{#key output} {#each logs as log}
<tt>{output}</tt> <h1>{log.type}</h1>
{/key} <tt>{log.content}</tt>
<br />
{/each}
</main> </main>