Giter Site home page Giter Site logo

rittvic / buckythebadgerbot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 130 KB

A Discord bot to search for courses, professors and other information at University of Wisconsin-Madison (UW-Madison).

License: MIT License

Java 99.80% Dockerfile 0.20%
discord discord-bot java jda jda-bot jda-discord-bot ratemyprofessors uwmadison uw-madison docker

buckythebadgerbot's Introduction

BuckyTheBadger Bot

A Discord bot to search for courses, professors, and other information at UW-Madison.

It needs permissions to read and send messages, use slash commands, and send embed links; and most importantly, it also needs application commands scope permission to register slash commands.

Commands

These commands are case-insensitive.

Note: This page may not be up-to-date. I try my best to update it whenever new features are added.

Search Command

/search <course to query>

e.g., <Calculus>, <Amer Ind>, <Math 340>, <500>

Queries the courses based on the user input and returns the best matches. You can click on every result through the generated buttons.

Course Command

/course <course>

e.g., <COMP SCI 577>, <Biology>, <102>, <Machine Learning> Searches for the specified course (or the top result) and displays the following information (in order):

  • Course Subject, Number and Title
  • Course Description
  • Cumulative GPA
  • Credits
  • Requisites
  • Course Designation
  • Repeatable For Credit
  • Last Taught
  • Cross-listed Subjects (if any)

Professor Command

/professor <professor>

e.g., <Hobbes>, <Boya Wen>, <Vermillion>

Searches for a professor and displays the following information (in order):

  • Department
  • Average Rating
  • Total Ratings
  • Would Take Again Percentage
  • Top Tags
  • Top Courses Taught You can also view student ratings for every course taught by the professor.

Gym Command

/gym Displays live usages for every gym equipment at the Nicholas Recreation Center and the Shell.

Dining Hall Command

/diningmenu <dining market> <menu type>

e.g., <Rheta's Market> <Breakfast>, <Gordon Avenue Market> <Lunch>, <Four Lakes Market> <Dinner>

Displays today's dining menu (breakfast, lunch, dinner, or daily) consisting of every food station and its servings, for any one of the six dining markets.

Development & Local Testing

To get a local copy of the bot up and running for development and testing purposes, see below:

Note: As of now, you are not able to test with the grade distribution graphs (which aren't necessary for testing purposes). This may change in the future once I set up an image file server for it (represented as .pngs).

Prerequisites

  1. Docker - This is used to containerize both the bot and the database, which makes it easy for setup.

If you want to test without Docker:

  1. Latest version of Java (need 18.0.2+)
  2. PostgreSQL - This is the RDMS used in the bot

Installation

  1. Clone the repo:
git clone https://github.com/rittvic/BuckyTheBadgerBot.git
  1. Edit the following configuration files (as necessary):
    • .env - Put your token variables here. Use .env.example as reference.
    • db_init.sql (optional) - This is for seeding the database. Use db_init_example.sql as reference (I may release my tool for this in the future).

    This is marked as optional because the bot can still function without the database, but the commands that rely on it won't work obviously.

    • docker-compose-yml (if using Docker) - Set the path to your docker image of the bot here, as well as the initialization script if you are using the database.

With Docker

  1. After making changes, build a docker image of the bot by running docker build -t <image-name>:<tag> <path to Dockerfile> (if in the same path, you can use . instead).
  2. Run docker compose up to see the bot and database in action.

Without Docker

if you are not using Docker, then after making changes, you will need to create a .JAR file of the bot, and have the database up and running on your machine. Make sure you are using the same database configuration tokens set in .env.

To create a .JAR file, simply run mvn package in your IDE and it will spit out a shaded .JAR file within the target directory of the project.

Contributing

If you would like to contribute, whether it is a suggestion or bug fix, please fork the repo and create a pull request. Any contributions would be appreciated :)

  1. Fork the project
  2. Create your feature branch - git checkout -b feature/YourFeature
  3. Commit your changes - git commit -m 'Add this YourFeature'
  4. Push to the branch - git push origin feature/YourFeature
  5. Open a pull request

Built With

  • Java Discord API (JDA) - a Java wrapper for the Discord API
  • Jackson - High-performance Java library to parse and serialize/deserialize JSON
  • PostgreSQL and PostgreSQL JDBC Driver - a SQL relational database management system powered by JDBC (allows Java programs to connect to the database)
  • HikariCP - Lightweight, fast JDBC connection pooling framework
  • Docker - Software containerization platform
  • Dotenv - Module to load environment variables
  • logback-classic - Reliable, flexible logging framework
  • Maven - Dependency manager

Where I Get The Information From

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note: This project is not affiliated with UW-Madison.

buckythebadgerbot's People

Contributors

rittvic avatar

Stargazers

 avatar

Watchers

 avatar

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.