Skip to content

JacobGraham02/StudentBotHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StudentBotHelper

  1. About The Project
  2. Project purpose
  3. Built With
  4. Things I learned
  5. Challenges I faced
  6. Getting Started
  7. Usage
  8. Contributing
  9. Contact me

About The Project

StudentBotHelper is a Discord bot primarily aimed at College and University students to act as both a tickler system and document repository, and to centralize onto one platform a lot of resources that students would find useful. In 2023 and 2024, a lot of students, incuding myself, use Discord for purposes ranging from gaming to school. Therefore, a Discord bot that is aimed at assisting specifically students will garner a lot of interest and be appreciated by the population of Discord users that are currently students.

Below you will find a large number of screenshots showcasing the bot and how various operations with the bot work:

Using the 'help' command with the Discord bot

StudentBotHelper running help command image demonstration

The bot command used to create a study group within Discord

StudentBotHelper creating study group command image demonstration

The result of the create group bot command

StudentBotHelper creating study group image demonstration

Generating a server-wide message with all currently-existing classes displayed for students to see the classes for the day

StudentBotHelper creating a message with all classes currently existing demonstration

A student is allowed to create a user that is registered with the bot

StudentBotHelper creating official class user with the bot demonstration

The result in the MySQL database of a user being created

StudentBotHelper class user result in the mysql database

A command that allows the creation fo a common class: a class that all students have in common

StudentBotHelper creating class that all students have in common demonstration

The result in the MySQL database of the user common class being created

StudentBotHelper common class result in the mysql database

An image showing the Discord channel which holds all of the activity on the bot GitHub repository

StudentBotHelper webhook showing github repository activity demonstration

An image showing all of the database operations performed by using the Discord bot

StudentBotHelper database operation messages image demonstration

An image showing the MySQL database structure that was created for the bot

StudentBotHelper database structure demonstration

An image showing a scheduled Discord event being created within the server

StudentBotHelper scheduled event StudentBotHelper scheduled event details

An image showing the bot information log messages

StudentBotHelper log messages

An image showing the bot information error messages

StudentBotHelper error messages

An image showing the bot can create a button that allows a user to get the bot role

StudentBotHelper bot role creation button StudentBotHelper bot giving user the bot role

(back to top)

About The Project

StudentBotHelper is a Discord bot primarily aimed at College and University students to act as both a tickler system and document repository, and to centralize onto one platform a lot of resources that students would find useful. In 2023 and 2024, a lot of students, incuding myself, use Discord for purposes ranging from gaming to school. Therefore, a Discord bot that is aimed at assisting specifically students will garner a lot of interest and be appreciated by the population of Discord users that are currently students.

The bot is continuously being developed and improved so as to keep on top of current trends in the software development industry, and to ensure compatiblity with the current version of MySQL, the Discord API, and with Microsoft Azure. Below is a summarized list of all the functions that the Student Bot Helper currently can do:

  1. Registering an account to use with the bot
  2. Creating a private 'thread' session with the bot. This simulates a real session that you would typically establish if you were using a web application
  3. Creating a private group dm with bot and up to 4 other users.
  4. Generating a google maps uri for information of a specific place (utilizes the google places api)
  5. Generating a google maps uri for directions from one place to another place (utilizes the google directions api)
  6. Deleting your user account (if the account is associated with your discord username)
  7. Typing the '/help' command to get more information about what commands can be used with the bot
  8. Having Discord events created automatically for classes in the present or future

(back to top)

Built with

  1. TypeScript
  2. Microsoft Azure
  3. MySQL
  4. Discord.js
  5. Google Places API
  6. Google Directions API
  7. Node.js

(back to top)

Things I learned while building this project

While building this Discord bot, I learned how to write complex applications in TypeScript, further my skill in developing web applications using Node.js, while following proper SOLID and DRY software development principles. I built this entire application with a keen eye given towards creating loosely-coupled code that is easy to modify, easy to test, and can integrate well with third-party platforms such as Microsoft Azure. So far, I have created a loosely-coupled database repository class that uses SSH to securely connect with a MySQL database on Microsoft Azure. I learned how to write both unit tests so that I could verify my application functions perform properly, and integration tests with the Azure MySQL database so that I know my application can interact with the database correctly.

Additionally, I used optimal software development architecture to build this application, using the repository design pattern for the database, and utilizing entity classes to construct objects to use. I used Docker to make a Dockerfile that will allow any user to download the project and just build the constructed Docker image to quickly build their version of the project and get started immediately, without having any problems or potential roadblocks with their project.

I added many features to this project to make the bot as compatible as possible with similar real-life implementations of other Discord bots. Below are some of the things I considered when building this Discord bot project:

  1. Used UUID data types instead of integer ID's for the database to allow for integration with other databases
  2. Used the repository design pattern to create loose coupling between the application layer and the data layer, allowing for flexibility in dealing with changes
  3. Wrote several utility classes containing functions that take input data and normalize the data to create objects which can be used with the Discord API

Challenges that I faced while building this project

While building this Discord bot, the most prominant challenge that I faced was when debugging errors or thrown by the Discord API, as the Discord API throws very abstract and general error messages, which required me to sequentially go through the stack trace and thoroughly investigate every file which appeared in the stack trace in order to find which file was causing the problems. Any Discord API error which was thrown included an error code which I could search for on Google to assist me in finding which file could be causing the problems.

Another significant challenge that I faced while building this project was building the project to be as appliable to the real world as possible (using proper design patterns, following SOLID and DRY principles, and designing the application to be able to merge seamlessly with other similar applications). In my project, I had to create a custom Discord client in the folder utils/CustomDiscordClient that interacts with the Discord API because of the custom additions I added to my bot.

Getting started

The following section gives you instructions on the prerequisites you need to set up StudentBotHelper locally on your own Discord server

Prerequisites

First, you must have Node.js installed on your machine. You can download Node.js from Here

If on Windows

Click on the download button that says 'Recommended for Most Users' as the bottom text.

If on MacOS

Click on the Nodejs download link here. Once you are at the Nodejs downloads page, click on the download button which says 'macOS Installer'

If on Linux

Click on the Nodejs download link here. Once you are at the Nodejs downloads page, you have one of two options for installers: Linux 64-bit binaries: Click on the '64-bit' button to the right of the text 'Linux Binaries (x64)' Linux ARM binaries: Click on the 'ARMv7' or 'ARMv8' button to the right of the text

Once you have downloaded an installer, proceed with the installation of Node.js. You can check to see if your Nodejs installation was successful by opening the Windows command prompt, MacOS terminal, or Linux terminal and typing the following command:

Once you have successfully installed Node.js on your system, type in the following command into your command prompt or terminal:

npm install npm@latest -g

Installation

TODO

(back to top)

How to run the tests

TODO

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions that you make are greatly appreciated.
If you have a suggestion that would make this better, please fork this repository and create a pull request. You can also simply open an issue with the tag "enhancement".
Below are some example steps on how to create a pull request for this repository:
  1. Fork the Project
  2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
  3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
  4. Push to the Branch (`git push origin feature/AmazingFeature`)
  5. Open a Pull Request

(back to top)

Contact me

Jacob Graham - jakegraham54@gmail.com

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages