Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

JoshQuaintance/catalactics-bot

Repository files navigation

Catalactics-Bot

ChecksDeploy to Heroku

Welcome to my GitHub repository for my Discord Bot. This bot is MIT Licensed, that means you can use it as is, and there is not guarantee on the product. This project is open source and you can contribute on it, check Contribute.

Contributing

You want to contribute on this Discord Bot, come along, let me tell you how:

  1. Install the necessary softwares. (Important)
  2. Fork this repository.

forking

  1. Clone the forked repo to your local machine and cd to the directory. You can do so using this command in the git bash: git clone https://github.com/Your-Username/catalactics-bot. If you are using VSCode, you can use the Integrated terminal for this. Look at the full documentations for this.

Clone Gif

  1. Create a new branch

Github Branch

  1. Make changes to the code. Add, update, or fix the code.
  2. Test/debug your changes by running the bot locally.
  3. Commit changes and then get a Pull Request (PR).

Thank you for contributing to this Repository.

Install Necessary Softwares

If you're contributing, before doing anything else, install the following Softwares, these are the necessary tool to run this Bot:

Software Version Additional Notes
Node.js 12.x Install Node.js
npm 6.x Come bundled with Node.js. We used the bundled version, no LTS releases.
git 2.x Download Git
MongoDB Compass* 1.x Download MongoDB Compass Community
This is not a required tool, this is just for database visualization.

*Not Required / Optional

You are also going to need to install a Code Editor if you do not have one already. There are a lot of them out there, but what we recommend are Visual Studio Code and Atom Code Editor. Either one of these two are good, pick which one you like.

Getting the Bot into the Server

This bot requires the Administrator permission to run. We generated a link for you that will do that, all you need is a Client ID. Here's how you can get your bot up:

Go into the Discord's Website, then go to the Developer Portal and Sign in. You can use this link.

  1. Press the New Application button on the top right of the screen. Then give your application a name and press Create.
  2. Select your new Application by clicking on it.
  3. Go to the Bot section.
  4. Press the Add Bot, and press Confirm

Add New Bot

  1. Go back to General Information.
  2. Copy the Client ID.

Get Client ID

  1. Go to this link, scroll down and enter in your client ID. Then Click on the link generated at the bottom.

Get Server Permissions

  1. Then it's going to ask which server you want the bot in. Pick the server you want and click Select. Then, It's going to show a form full of permissions, scroll down and click Authorize. Finish the captcha.

Captcha

...and you're done, your bot should slide in to your server. There is still some stuff to do to get it running.

Running It Locally

To run this bot locally, follow these steps:

  1. Go to the folder where your cloned repo is.
  2. Create a new file inside it called .env.
  3. Inside the .env file, add your discord token like the example:
DISCORD_TOKEN=your-discord-token

You can get your discord token through the discord portal in the Bot section of your application.

Get Token

  1. Then inside the .env file, add a prefix like the example below (The default prefix is "!"). This is how you're going to call the bot later on. Ex:

    PREFIX="your-prefix"
  2. Add another variable named JOIN_LEAVE_CHANNEL with a text channel where you want to log new user welcomes, the default channel is "introductions". Ex:

    JOIN_LEAVE_CHANNEL="introductions"
  3. Add another variable named COMMAND_LOG_CHANNEL with a text channel where you want the bot to log the commands that were called, the default channel is "commmand-logs". Ex:

    COMMAND_LOG_CHANNEL="command-logs"
  4. Add another variable named BOT_LOG_CHANNEL with a text channel where you want the bot to log when the bot is up/online, the default channel is "bot-logs". Ex:

    BOT_LOG_CHANNEL="bot-logs"

    This is what the whole .env would look like without the comments: dotEnv File

  5. Open up a terminal in the folder. (If you are using VSCode, you can press `CTRL + `` Shortcut)

  6. Type the following command and hit enter:

npm i
  1. Now, you can edit the code.
  2. After you're done with that, type the following command and hit enter to run the bot:
node index

That's all. The bot should log an embed with the time it was woken up and account used inside the channel you specified inside the .env file with the variable BOT_LOG_CHANNEL. The default value is "bot-logs". If you don't have this channel, it will not log it.

Commands Available

Prefix Description
ping Pings the Bot, and it will reply with a message containing the Ping of the bot.
about Give the BOT a little description of itself. They deserve some too.
help Displays all of the commands available. If a command is specified, it will display the description of the command. That's this command
stats Shows the status of the bot.
uptime Shows the uptime of the bot
role Advanced role command, additional arguments will change how it react.
roles Gives a list of the roles and a little description of what they do

Dependencies

Dependency Version
discord.js ^12.2.0
dotenv ^8.2.0
mongoose ^3.5.9
mongodb ^5.9.19

Additional information

This project is for fun while providing a small service to everyone out there.

Need Help or You want me to set it up for you?

If you need help with anything or want me to set it up for you, you can contact me directly through any of the following:

Discord Server - https://discord.gg/B3nRNez

Twitter - @bigbrainfes

Instagram - @joshuahasian_04

I would be happy to help you.

Contributors

Joshua Pelealu - Repository Owner

Remember to Stay Safe and Happy Coding!!🙂

Catalactics