Code Monkey home page Code Monkey logo

discord-utils-bot's Introduction

Discord Utils Bot

This is a small project I made for fun to learn about the Discord api and the DiscordJS wrapper.

At first this was only supposed to be a simple command handler I made because a friend of mine couldn't get to create one, but it might get even better in the future, and maybe be become a full multi-tooling bot :D

Informations

This project is built entirely with Typescript, and I am trying to use as few external modules as possible.
For now, I am only planning to add an orm for my database connexion.

Dependencies

To run this project, you will need the following dependencies:

  • NodeJS 16^
  • NPM 7^
  • Yarn 2^

(This project has not been tested with prior versions and might be unstable)

You can check your dependencies requirement by running the following commands:

$ node -v
$ npm -v
$ yarn -v

And, last but not least, you will need a database to store all the server's data. This project is built using PostgreSQL, and has not been tested with any other relation database.

If your computer is ready to host the code, you can now clone the project using the git clone command:

$ git clone https://github.com/Zuruuh/discord-utils-bot.git
$ cd discord-utils-bot

Now that you downloaded the project, install all the project dependencies by running the yarn install command:

$ yarn install

If everything went correctly, your project should be good to go ! The last thing it needs is configuration...

Configuration

If you have Docker & Docker-Compose installed on your computer, you can just run the following command to get the database started.

$ docker-compose up -d

Once this is done, you can directly head to the Start Section.
If the docker command failed, just follow the instructions right below.

Last step before the project is up and running; get your bot's token and add it to the .env.example file.
Next, you will find a DATABASE_URL variable with differents constants in it's value (constants are written in capital letters).
You will need to replace all theses constants with your actual database connexion string informations.
If you don't know what each of the constants mean, check the text underneath this one for more informations.

DB_USER: Your database user. By default, there should always be a postgres user
DB_PASSWORD: Your database user's password. By default, it should be either null ("") or "root"
HOST: Your database hostname. If you host your database locally, this should be "localhost".
Else, you should be able to find something similar on your database provider.
PORT: The port to connect to. If you host your database locally, set this to "5432".
Else, you should be able to find the correct port on your database provider
DATABASE_NAME: Your database's name. This name is arbitrary as long as you create your database first.

Start

Now that all your environment variables are created, rename your ".env.example" to be ".env". NAnd there you go! Your project is ready!
Just run the following commands and your bot should wake up :)

$ yarn p:m:m
$ yarn dev

And there you go ! Your bot is up and running ๐Ÿ˜„

discord-utils-bot's People

Contributors

zuruuh avatar

Watchers

 avatar  avatar

discord-utils-bot's Issues

Message experience

Add experience to a counter to user on message send.
Restrict experience gain to once per minute.
Exponentially increase experience cost to get to next level.
Implement in-app Leaderboard + pagination.

Word react

Allow users to add a word react (Max: 15 per server)
If message contains word (use regex to parse data), react to message with saved emoji

Captcha

Implement captcha on user join

Word answer

Allow user to add a word answer (max: 15 per server)
If a message contains this word, reply with saved content.
Allow users to set word as ending-only (reply only when word is at the end of a sentence)

Refactor Commands

Refactor Abstract Command Class to be an annotation instead to be easier to maintain and use

Implement giveaway system

Allow users to create giveaways with a set timer (min: 2 mins; max: 2w)
Allow users to choose a custom rewards, a set number of winners.

Customizable Server Messages

Customizable messages on user join/leave server.
Implement image manipulation to include the user's profile picture + a small text underneath

Join to create

Let users create a vocal channel by joining a specific one.
Allow users to manipulate their own vocal channels.
Delete channel when all users inside left.

Infractions system

Allow moderators to warn a user.
Let moderators remove the warns they added themselves (or mods with higher privileges).
Create per server sanctions config on specific warn amount.

For the sanctions, implements =>

  • Add/Remove role
  • Kick/Mute/Tempmute user with custom reason + duration
  • Ban/Tempban user with custom reason + duration
  • Send message in dm or in specific channel with custom content

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.