kph4m / MBot

A multi-purpose discord bot.

Home Page:https://kph4m.github.io/MBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MBot

Table of Contents

  1. Overview
  2. Inspiration
  3. How it's made
  4. Challenges
  5. Set-up
  6. Commands
  7. Demo
  8. Future
  9. TODO

Overview

MBot is a multi-purpose discord bot with administrative commands, mini-games, currency system, and experience system that was created for entertainment purposes.

Inspiration

As someone who uses Discord frequently, I wanted to create a bot that automated my tasks and could be used for entertainment purposes.

How it's made

As this was just a bot within Discord, it was mostly backend work. After initially setting up the bot to accept commands using Discord.js (Node.js module) , I was ready to start implementing features. I developed the features through an iterative process, where I would first brainstorm what the feature required (database, libraries, etc.), then implementing and coding the feature, and then finally testing the feature thoroughly to make sure it worked properly and didn't have any bugs.

The database schema consisted of 5 main fields: userID, serverID, money, xp, and level. A schema gets created for each user upon typing in the chat. The data can be read and updated depending on the command.

Schema

After about 3 months of adding features, I deemed it to be sufficient to publish online so that other people could use it. Initially, I used Heroku for hosting but they later announced that they would get rid of their free tier so I migrated to Railway.

image

Challenges

Figuring out the best way to implement features was the biggest challenge, especially the ones that required a database since I had no prior knowledge of using databases. With enough research, I learned how to update and retrieve user data from MongoDB. This knowledge helped me implement many important features, such as the experience and currency system, as well as user profiles.

Set-up

  1. Create a Discord account
  2. Create a server
  3. Click here to invite MBot to your server
  4. Check out the commands below and have fun!

Commands

All commands that can be performed by MBot. Prefix is $. Simply type the command in the message box and press enter.

Game Commands Description
$rps Play rock-paper-scissors
$flip Play heads-or-tails
$math Answer math questions
Administrative Commands Description
$kick @<username> <reason> Kicks a user from the server and records the reason
$ban @<username> <reason> Bans a user from the server and records the reason
$clear <amount of messages> Deletes the specified number of messages in a channel
Coin Commands Description
$coins Shows number of MCoins you have
$coins @<username> Shows number of MCoins a user has
$pay @<username> <amount of MCoins> Transfers specified amount of MCoins to specified user
(Admin)$generate <amount of MCoins> Add a certain number of coins to your account
$reset Sets users MCoin balance to 0
Miscellaneous Commands Description
$userinfo Shows your stats
$userinfo @<username> Shows stats of specified user
$hello MBot greets you
$tuturu Tuturu!
$report @<username> <reason> Reports a user with a reason
$lvl Shows your level card
$lvl @<username> Shows level card for specified user
$rating <attachment> Adds πŸ‘ and πŸ‘Ž reactions to attachment
$poll <sentence> Adds πŸ‘ and πŸ‘Ž reactions to poll
$remind <message> Reminds the user of the specified message after a specified period of time

Demo

Video

Future

I don't have any current plans to implement more features but maybe I'll be inspired in the future.

TODO

  • Migrate to different host.
  • Publish code.

Thanks for stopping by!

Mayuri Wave

About

A multi-purpose discord bot.

https://kph4m.github.io/MBot


Languages

Language:JavaScript 100.0%Language:Procfile 0.0%