A Discord bot for the Caves of Qud discord (invite link).
Features:
- Decode Caves of Qud character build codes into formatted character sheets
- Perform title and fulltext searches on the official Caves of Qud wiki
- Render tiles from the game and send them to Discord as attachments, with optional recoloring previews for modders
Cryptogull depends on another Trash Monks project, the hagadias library, to read the game files.
Contributions from the community in the form of issues or pull requests are
welcome. This project uses the Code of Conduct available from that Discord
server, in the #code-of-conduct
channel.
- Clone this repository. You need Docker installed.
- Create a
config.yml
in your project directory from the providedconfig.example.yml
. - Log in to the Discord Developer Portal and create a new application. The name of the application is not your bot's username.
- Skip directly to the "Bot" tab of the application you created. Set the icon
and username here. These can be changed later. Click the button to reveal the
bot token. Copy this token into the
Discord token:
field inconfig.yml
. - Turn on the "Server Members Intent" slider in the Bot tab.
- If you don't have a private Discord server to test in, make one.
- Grab the 'Application ID' from the 'General Information' tab of the Discord application you created (different from your bot token!)
- Grab the permissions number you need from the 'Bot' tab of the Discord application you created. This should be 100352, which is the number created by checking the 'Send Messages', 'Attach Files', and 'Read Message History' checkboxes. If you're developing features that use higher permissions, check those permission boxes as well and use the permissions number created by doing that.
- Craft a URL to join your bot to your server. The format is
https://discordapp.com/api/oauth2/authorize?client_id=xxxxxxxxxxxxxxxxxx&scope=bot&permissions=y
where thex
s are the number from step 7, andy
is the number from step 8. - Go to the URL and accept any prompts.
- Run the bot through Docker using the commands below.
To build and run the bot:
docker build . -t cryptogull:latest
docker run -it --rm -v ./config.yml:/home/cryptogull/config.yml -v "C:\Steam\steamapps\common\Caves of Qud":"/home/cryptogull/Caves of Qud" -v ./Textures:/home/cryptogull/Textures --name cryptogull cryptogull:latest
This attaches the config file, game data folder, and tile art folder as volumes inside the running container.
Tile support requires a full extract of the game Textures directory. To get an
up-to-date copy of the game textures, install the
brinedump mod and use the
brinedump:textures
wish.