No description
Find a file
2025-03-05 19:55:17 -05:00
src fix: improve game state checks and enhance deck loading logic 2025-03-05 19:55:17 -05:00
.gitignore add leaderboard functionality and cleanup code [results of private group beta testing] 2025-03-05 15:19:43 -05:00
bun.lock implement manydecks format 2025-03-02 00:17:36 -05:00
LICENSE.txt update readme + license 2025-03-03 15:37:47 -05:00
package.json implement manydecks format 2025-03-02 00:17:36 -05:00
README.md update readme + license 2025-03-03 15:37:47 -05:00
tsconfig.json init + boilerplate 2025-03-01 00:08:56 +00:00

DeckBot

Custom locally-run CAH bot for Discord that I made in a weekend.

CC BY-NC-SA 4.0

Thanks to crhallberg for the CAHDeck JSON library and Reread Games for the ManyDecks format.

Requires:

  • Bun
  • Discord Developer Access
  • Friends

Commands:

  • /cah [max-points] - Start new game with given point limit in new thread of channel
  • /play - Join game in thread
  • /select [number(s)] - Select card(s) to play, or winner as Czar
  • /add [code] - See below

How to run:

  1. Clone repo
  2. Install bun and run bun install
  3. Make .env and fill the following values from Discord.dev Dashboard:
DISCORD_TOKEN=<TOKEN>
DISCORD_CLIENT_ID=<CLIENT_ID>
DISCORD_GUILD_ID=<GUILD>
  1. Run bun run src/index.ts
  2. Add to server
  3. Play the game

How to add decks:

Easy method (ManyDecks):

  1. Get a deck code from Many Decks.
  2. Type /add <CODE> into Discord.

Harder method (ManyDecks & JSON Against Humanity):

  1. Download deck file
    • JSON Against Humanity:
    • ManyDecks:
      • If you made the deck, login to ManyDecks go into the edit page for the deck and click "Download"
      • If you didn't make the deck, you can go to https://decks.rereadgames.com/api/decks/CODE (replace CODE with deck code) and download the .json5 file that appears in the browser
  2. Drop in either src/decks/json or src/decks/manydecks based on source.
  3. Reload bot

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, as per the original Cards Against Humanity® license.

CC BY-NC-SA 4.0