catnip
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v349View latest version
Thanks for your interest in contributing! Catnip is a Discord bot template built for Val Town's serverless Deno runtime.
- Fork and clone the repository
- Copy
.env.exampleto.envand fill in your Discord application credentials - Install Deno if you don't have it
deno test --allow-env --allow-net --no-check
All 1621 tests across 126 files should pass. Tests use mock modules for SQLite, blob storage, and Val Town utilities (see test/_mocks/). See the README for a full coverage breakdown.
- Create a new file in
discord/interactions/commands/ - Use
defineCommand()to declare the command and its handler - Register the component handler if needed in
discord/interactions/components/ - Run discover + register via the admin endpoints
See the README for a full walkthrough with examples.
- TypeScript with Deno conventions
- No external dependencies beyond Val Town standard libraries and Deno std
- Use
UserFacingErrorfor errors shown to Discord users - Use
createLogger()instead ofconsole.logfor production logging - Parameterize all SQL queries — never interpolate user input
- Use
kv.update()orkv.claimUpdate()for atomic mutations
- Keep changes focused — one feature or fix per PR
- Include tests for new commands or behavior changes
- Make sure all existing tests still pass
- Update the README if you add commands, env vars, or endpoints
Open an issue on GitHub with:
- What you expected to happen
- What actually happened
- Steps to reproduce (if applicable)
For security vulnerabilities, see SECURITY.md.