By: 0xDrMoe
Install the following before continuing to contribute to this project:
- Go to the Discord Developer Portal
- Click on
New Application
in the top right and give the bot a name
- Navigate to the
Bot
tab on the left and click onAdd Bot
- Now, make sure to copy the token and store it somewhere safe. You will need it later. Note that you will not be able to see the token again after you close the window.
- Clone this repository into your own directory using
git clone https://github.com/0xDrMoe/Town-of-Mods.git
- Open your editor and ensure that you have a terminal open in the directory you cloned the repository into
- If you are using Visual Studio Code, you can open a terminal by pressing
Ctrl + Shift + ~
(Ensure that it is a Bash terminal)
- Run
npm install
to install all the dependencies specified inpackage.json
- Now that you have installed everything, you can start setting up the bot. Your directory should look something like this:
- Rename
config.json.example
toconfig.json
and fill in the values as follows:
{
"clientId": "123456789012345678",
"guildId": "012345678901234567",
"token": "FAKE_TOKEN_DO_NOT_USE",
"joinRole": [],
"utils": {
"HOSTNAME": "localhost",
"DBUSERNAME": "root",
"DBPASSWORD": "password",
"DATABASE": "database"
}
}
clientId
is the Application ID under General InformationguildId
is the ID of the server you want to run the bot ontoken
is the token you copied earlierjoinRole
Ignore this for nowutils
is the database information. You can ignore this for now as well
- Now, you can run the bot by running
npm start
in the terminal. You should see the following output:
- If you see this, then you have successfully set up the bot! You can now invite the bot to your server by going to the
OAuth2
tab on the left and going toURL Generator
selecting thebot
andapplications.commands
scopes. Then, copy the link and paste it into your browser. - Invite the bot to your server and you should see it online! Make sure to give it the
Administrator
permission. If you want this done automatically, check theAdministrator
permission underBot Permissions
in the same tab and copy the link to invite the bot. - The bot should now be online and you can start contributing to the project!
- To test the bot, you can type
/ping
in the server and it should respond withPong!
Copyright © Town of Host: Enhanced 2023