If the change you'd like to make is simple enough such as fixing a tpyo, you can simply fork the repo, edit the file using GitHub's online editor, and make a pull request. Otherwise, use the following instructions:
- Fork the repository and clone it with Git.
- Navigate to the directory in your terminal and run
npm i
to install the necessary packages. - Create your Discord bot at the Discord Developer Portal applications page.
- Create a MongoDB database. (Tip: use Atlas for a free database).
- Rename the .env.example file to .env and fill in the fields.
- Run
npm run dev
to open your server athttp://localhost:3000
. This will automatically update as you change your code so you don't need to rerun the command. - Make your changes, you can look at the file structure overview if you're not sure where you should be.
- Once you're satisfied with your changes, create a commit and make a pull request.
Here's an overview of some of the directories and important files in the project.
src/
- Source code is here.
src/hooks/
- Svelte thing, not yet implemented.
src/lib/
- Svelte components and other code.
src/lib/database/
- Code that interfaces directly with the database or helps with database operations.
src/lib/discord/
- Code relevant to the Discord API and the bot.
src/lib/discord/api/
- Code that interfaces and abstracts the Discord API.
src/routes/
- Each file here is a different HTTP route, the .svelte files are for HTML and the .ts files are for other stuff.
src/routes/api/
- All the API routes are here.
- discordinteraction.ts - This is the webhook where Discord notifies us whenever someone uses an interaction.
- __error.svelte - This is the error page, used for 404s, etc.
- __layout.svelte - Layout for all pages. If you want to add something to all pages, go here.
static/
- Some of the static files are here, this will probably change in the future.