This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].
We use yarn as our package manager.
-
Clone the repository template
$ git clone https://github.com/UCLA-Creative-Labs/discord-bot-template.git $ cd discord-bot-template $ yarn install -
Register a new Discord Bot through Discord's Developer Portal:
-
Set your environmental variables:
- For development, create a file
.envin the project's root directory and set the variables belowdotenvis used to handle environmental variables
DISCORD_CLIENT_ID=YOUR_BOT_APPLICATION_ID_HERE DISCORD_TOKEN=YOUR_BOT_TOKEN_HERE(Optional)
- Set an environmental variable for our Creative Labs Discord to deploy new commands without re-inviting the bot
- Right click on our server name and click
Copy Server IDto get the guild ID
TEST_GUILD_ID=OUR_SERVER_ID - For development, create a file
-
For development, you can watch files with:
$ yarn dev -
To deploy commands for the
TEST_GUILD_IDserver:$ yarn deploy -
To build the TypeScript app into a JS distribution:
$ yarn build -
Finally, to run the production app:
$ yarn start
We recommend checking out this tutorial.
Some sample commands are set up in ./src/commands/, including a simple reply and a modal popup.
New command .ts files should be imported in ./src/commands/index.ts.
Feel free to contribute more samples of different types of commands and UI.
Thanks for your interest in contributing to Project! ❤️
Here's a quick guide on how to get started.
- Fork the repository or checkout a branch;
masteris protected and is managed through our pipeline. - Create an issue and/or mark an existing one to let everyone know that you are working your magic ⚡️
- Beep boop away!
- Before you push, it's always a good idea to check that your changes follow our linter rules! Run
yarn lintat the root directory and watch it judge your code. - Stage, commit, and push your changes to make a pull request!
- A maintainer will review your code and if it passes all the checks, your contribution will be merged on to
master🥳
See CONTRIBUTING.md and DESIGN_GUIDELINES.md for more info.
If you ever need help with a feature or bug fix, no worries! Feel free to mark the issue as guidance so that our maintainers can start thinking about a solution. If you are comfortable making a draft pull request, you can also tag the Creative Labs team in a comment: @UCLA-Creative-Labs/team!