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