Project made by Simon He
Versions:
- Node: v10.0.0
- Npm: 6.12.1
- Discord.js: 12.2.0
To run application, you have to set up your own bot and have packages installed.
To do this:
- To use discord.js, you'll need to install Node.js. You can do so by going to the node.js website
- Npm comes packaged with node but additional packages you will need to install are
- discord.js
- dotenv
- ytdl-core
- @discordjs/opus (If you had trouble installing native code like me, run npm install --global --production windows-build-tools)
- ffmpeg
- fluent-ffmpeg
- Make sure you don't have people stealing your API keys
- Create a .env file to store your precious keys
- Create a .gitignore if you haven't done so and add .gitignore and .env to that so when you commit it to your repo, it won't show.
- Finally, to set up the bot for your server
- login to the discord website and login
- Hover over the "Developers" drop-down menu and click the Developer Portal
- Click on the "New Application" button and fill in the information
- Select the "Bot" link and click "Add Bot"
- Select the "General Information" link and copy your Client ID
- Paste your Client ID right after where it says client_id=, right before the & (https://discordapp.com/oauth2/authorize?client_id=&scope=bot)
- Select the server you want to add your bot to and press "Authorize" (If you look on Discord you should see the bot on the server)
- Select the "Bot" link on the Discord website and copy your token by pressing the "Copy" button
- Now in your .env file, create a variable called TOKEN and set it equal to your token
- To run the program open up a terminal or command line and go to the root folder of your application and type node index.js