Skip to content

Jxl-s/discord-casino

Repository files navigation

Discord Casino

Note: I don't condone gambling, and this is just a fun project for learning purposes.

A minimalist example of a Discord activity, as a simple casino game with fake currency. Developed using Discord's Embedded App SDK and SvelteKit.

Stats are synchronized across sessions using a JWT token, and actions are sent to the server to process game logic.

Snapshot Snapshot

How to run

Create a new application on Discord's Developer Portal, and retrieve the client ID and client secret. Create the activity afterwards.

Create a new .env file in the root directory of the project and add the following:

# Discord
PUBLIC_DISCORD_CLIENT_ID=1234567 # App client ID
DISCORD_CLIENT_SECRET=abcdef # App secret

# JWT
JWT_SECRET=good-jwt-secret # Key for JWT

Running the application

yarn
yarn dev

Running the tunnel

Use cloudflare tunnels to expose the local server to the internet, then add a URL mapping with the new URL into the activity settings of the portal.

cloudflared tunnel --url http://localhost:5173

About

Demo of using discord's embedded app SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published