Skip to content

Instantly share code, notes, and snippets.

View Kycermann's full-sized avatar
🎯
Coding

Mieszko Kycermann Kycermann

🎯
Coding
View GitHub Profile
@Kycermann
Kycermann / storybro.js
Created June 14, 2023 17:45
Storybro - Deno KV Hackathon Entry
import { serve, json, validateRequest } from "https://deno.land/x/[email protected]/mod.ts";
import { InteractionResponseTypes, InteractionTypes, createBot } from "https://deno.land/x/[email protected]/mod.ts";
import nacl from "https://cdn.skypack.dev/[email protected]?dts";
import { withSafeAtomics } from "https://deno.land/x/[email protected]/mod.ts";
// Try it out here: https://discord.gg/5nBCAa45
const kv = withSafeAtomics(await Deno.openKv());
serve({

Authenticate

1. Link to /auth/discord

Redirects the client to the Discord OAuth flow.

This will redirect the user to /?session=

2. ?session=<SESSION>