A bot to play snake on discord
Visual Studio Code with the following packages:
- ESLint
- Jest
- npm Intellisense
- Path Intellisense
- vscode-icons
If you already have NPM installed you can skip this section. You can check this by running node -v and npm -v in your terminal.
- Install Node.js
- Verify your installation was succesful by running
node -vandnpm -vin your terminal.
If you already have an SSH key for your development machine linked to your GitHub account you can skip this section.
- Open your terminal
- Navigate to the directory where you want the local copy of the repository to be stored
- Clone the repository by running
git clone git@github.com:ptlm500/discord-snake.git - CD into
discord-snakeby runningcd discord-snake - Run
npm installto install the dependencies
- Follow these steps to setup a Discord Bot linked to your account. You'll use this bot for testing.
- Add a bot to a server you own
- Open the repository folder
discord-snakewith VS Code - Create a new file called
.envin the root folder of the project - Copy the following into
.env:
DISCORD_TOKEN="YOUR_TOKEN"Hopefully you're now ready to start up the bot! Test it out by running npm start in your terminal.
If you see "Ready !" logged out, your server is running.
Press ctrl + c in the terminal window to shutdown the bot.
Optionally, you can install nodemon to live update your bot as you make changes to the code!
- Run
npm install nodemon -gto globally install nodemon - Start the server by running
nodemon npm start - You can force a restart by typing
rsinto the terminal, and shutdown the bot by pressing ctrl + c