Skip to content

InfinityDevTech/boolean-but-better

 
 

Repository files navigation

Boolean

About

A bot for Conaticus' Discord server. A document of the development process has been made here: https://www.youtube.com/watch?v=xq2jR3_msmk.

If you like cool coding projects like this, subscribe to me at https://www.youtube.com/channel/UCRLHJ-7b4pjDpBBHAUXEvjQ

Documentation

Setup

Installation

  • Clone/Fork the repository
  • Run cd boolean
  • Run npm i

Setting up the .env

In order to setup the bot, you must create a .env in the parent directory as you can see in the example, .env.example.

In this file you must declare the bot's TOKEN - this is the token from the Discord Developer Portal.

Syntax:

TOKEN="your bot's TOKEN"

This will automatically be ignored from the .gitignore. So don't worry about this data being public.

Running the bot

In order to start the bot, you must run npm run dev to run the TypeScript developer environment. Don't worry about the other package.json scripts, they are for production.

Due to many of the values being hardcoded, in order to run your instance you will need to change some values - such as the guildId in config.ts as it is used for deploying slash commands.

Other Information

Embed Colours

General: "ORANGE"
Success: "GREEN"
Error: "RED"

Configuration

The configuration file is used for constant variables that will be reused in the application, such as ids and reaction messages. It is located at /src/config.ts - feel free to add anything that matches this description.

Data

Data is currently stored in the data.json file. Only reaction messages are stored here, which is why a database is not present. If you are adding more data handling to the bot, please switch to sqlite.

Config

Set

To specify something in the config find the config object in the config.ts file, after specify something like "NAME": <VALUE>.

Get

To read from it, require config then read the value specified by doing config.<VALUE TO READ>.

Logging

Console levels and their refrences

  • Fatal : logger.console.fatal("")
  • Error : logger.console.error("")
  • Warn : logger.console.warn("")
  • Info : logger.console.info("")
  • Debug : logger.console.debug("")
  • Trace : logger.console.trace("")
  • Silent : logger.console.silent("")

Channel logging

-Embed : logger.channel(<EMBED>, <CHANNEL>)

Contributing

Look at CONTRIBUTING.md to find out how you can help contribute to the development of this bot.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.9%
  • Shell 0.1%