-
Notifications
You must be signed in to change notification settings - Fork 79
Getting Started
- Fork this repository and use the
git clonecommand in your terminal to clone it to your machine -
cdinto the cloned repository and runnpm installto install the dependencies - create a new
.envfile in the repository with the commandtouch .env
You will need to enter a few things in the .env file. You can find an example file called .env.sample of which you can copy the entire contents into your newly generated .env file.
At a minimum, you must provide tokens for the items below. We'll explain how to retrieve those in the next sections.
DISCORD_API_KEYDISCORD_CLIENT_IDDISCORD_GUILD_ID
Leaving the other items as they are with their xxxxx's or '' will not cause issues.
If you already have Redis installed, you can skip this section.
- Go to https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/
- Follow the installation instructions for your OS to install Redis.
- Be sure to start the Redis service before starting Odin-Bot locally.
-
Click on
New Application -
Give the bot a name and click
Create. Try to make it unique since Discord may not allow a name if it has too many users with that same name.You'll now be taken to the bot's "General Information" page. When visiting the Developer Portal at a later time, you can reach the bot options through
Applicationsand selecting your bot. -
In the bot's menu, select
Bot -
Click on
Reset Tokenand copy the output. You may need to enter your 2FA code at this point -
Paste the copied token after
DISCORD_API_KEY=in your.envfile inside of the quotes
- In the Discord Developer Portal with your bot selected, Navigate to menu item
OAuth2 - Copy the
Client IDas shown - Paste the copied ID after
DISCORD_CLIENT_ID=in your.envfile inside of the quotes
- Open Discord
- Right-click your server to which you will later invite the bot
- Click
Copy Server ID. Note that Developer mode has to be turned on for this in DiscordAdvancedprofile settings - Paste the copied ID after
DISCORD_GUILD_ID=in your.envfile inside of the quotes
- In the Discord Developer Portal with your bot selected, Navigate to menu item
Bot - In the section
Privileged Gateway Intentsturn onServer Members IntentandMessage Content Intentand save these settings - Click on the
OAuth2menu item and then onURL Generator - In the
Scopessection, selectbot - In the
Bot Permissionssection select at least:Read Message HistoryView ChannelsSend MessagesManage MessagesEmbed Links
- Copy the generated URL for use in the next section
- Open the previously generated URL in your browser
- Select your personal server in the dropdown and click
Continuefor the bot to be added and to show up in your member list - In your terminal, navigate to the cloned repository and run
npm start. Note: If you are actively developing a command, feel free to runnpm run devandnodemonwill listen for changes and restart the bot for you.
At this point your cloned version of Odin Bot should come online and its commands should work!