Coder Social home page Coder Social logo

kaoushikmurugan / yet-another-better-office-hour-bot Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 3.44 MB

Yet Another Better Office-Hours Bot

Home Page: https://tomli380576.github.io/yabob-docs/

License: GNU General Public License v3.0

TypeScript 100.00%
discord-bot discordjs office-hours office-hours-bot office-hours-queue tutoring bot discord discord-office-hours discord-queue

yet-another-better-office-hour-bot's Introduction

I'm a fourth year Computer Sciene and Engineering major at UC Davis, with an interest in Software Engineering and Game Development!

  • ๐Ÿš€ Iโ€™m currently working on Yet Another Office-hours Bot (and some games ๐Ÿคซ)
  • ๐Ÿ”ญ Researching on using Deep Reinforcement Learning techniques to solve Rubik's Cubes in a human like manner
  • ๐ŸŒฑ Iโ€™m learning PyTorch and Unity
  • ๐Ÿ‘ฏ Iโ€™m happy to collaborate on pretty much anything
  • ๐Ÿ’ฌ Ask me about Computer Sciene, Physics, Games, Animation, and Puzzles!
  • ๐Ÿ“ซ How to reach me: (username)@(mail service from alphabet).com
  • โšก WCA_id="2013MURU01"

yet-another-better-office-hour-bot's People

Contributors

gracexichen avatar hansonguyen avatar kaoushikmurugan avatar kmminecube avatar liumegan228 avatar macintash1984 avatar noahroseledesma avatar tomli380576 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tomli380576

yet-another-better-office-hour-bot's Issues

Feature: `/easy_vc_setup`

Inspired by the vc problem that prof. Butner had recently.

Instead of letting the server admin manually create voice channels and manage permissions, we can let bob do that for them.
/easy_vc_setup will show a modal, ask for the vc category name and the number of voice channels they want. The names will default to Office 1 Office 2 and admins can change them later since bob doesn't check the vc names.

  • BOB will NOT keep track of these offices because all BOB does is makes an invite to whatever vc the helper is in, does a permission overwrite, and sends the invite to the student.

Performance: Use priority queue and dequeue

This is totally unnecessary but if we ever find YABOB to be slow there are potential time complexity improvements we can make:

  1. Maintain a hashmap of helper ids to priority queues. Map<string, PrioQueue<HelpQueueID>>. Each priority queue will have all the queue id' that the helper is approved for. Then we get $O(\log n)$ when using /next instead of $O(n)$ from going over all the queues.
  2. Use double ended queue for internal HelpQueueV2 implementation. Maintain a head and tail pointer/index and preallocate an array with the size of total number of people in the server. Head will point to the 1st student to dequeue and tail points to the last student. Every time dequeue() is called, return students[head] then head = (head + 1) % queue.length. Same thing for tail when some one joins. But this could be dangerous because indices bad lol

Make the Attendance tracking spreadsheet *per-server*

Currently, the attendance tracking google sheets is per-bot, not per-server. This means that if a same bot (or instance) of YABOB is in multiple servers, they all share the same google sheets, which may not be ideal.

Feature: Nicer Google Calendar Embed UI

Objective

The public embed UI provided by google calendar is really ugly and difficult to read, so we should built our own solution to make it look modern.

Feature: CLI setup wizard

Potential Features

  • bob create Initiate wizard
  • Ask if the user wants to generate default server templates (ask user for the number of classes, generate, then tell the user to change the names later)
  • Interactively ask the user to enable tutor attendance tracking. Require Google sheets id, enable api, calendar api
  • bob doctor check if credentials are set up correctly. Users can run this if BOB is down for whatever reason.
    • Check if the .env file exists and has all the credentials
    • Send a simple request to see if the documents are actually accessible, abort if any requests fail
  • Dedicated bob-config.json to store settings of every bob instance

Feature: `/start_exam_review`, `/stop_exam_review`, and google sheet integration

Initial Idea

Exam review session mode for /start. We can keep track of exam review sessions this way:

  1. Helper uses /start examReview=True
  2. Show a modal asking for a zoom link. Use try catch with the URL() constructor to test if it's a valid url
  3. This link will override the normal queue content in QueueDisplay
  4. When students use /enqueue or [JOIN], YABOB will say that there's a review session in progress and show them the zoom link.
  5. (Optional) When they use /stop, YABOB will show another modal asking for a recording link.
  6. Send all of these data to google sheets through new events onExamReviewStart and onExamReviewStop

Deploy on AWS with at least 2 stages

  • Run in docker container
  • Set up Github actions to automatically deploy a stable branch
  • Use .env files instead of .json and provide an example .env.example file

Improve the way the bot figures out who is the helper for an event

Currently, the mapping of "Calendar name to discord id" works and helps prevent linking of discord info and personal names directly on the calendar

However it isn't necessarily an easy setup, and admins might find it annoying.

  • Requiring a resource (the google sheets) other than the calendar to work
  • A strict format that the google sheets needs to follow
  • Additional work for helpers to figure out a calendar name, and having to follow a particular format when adding events to the calendar

/start and /stop conflicts with each other

Steps to reproduce:

  1. Student close dm's
  2. Student use [Join Notif]
  3. Tutor use /start will lead to "you are already hosting"
  4. Tutor use /stop will lead to "you are not currently hosting"

Multiple helpers on one queue

Currently, the bot assumes that if your calendar name is in the name of an event, then you are doing to tutor/help for all the queues that you can help for.

Since there are some instances where helpers might want to help for only one certain queue, e.g. for midterm or final review sessions, we would want to for the bot to identify which queues an event is for.

Suggested idea: Have the list of queues for which the event is for in the description of the calendar event. If empty (or no queues listed), default to all queues.

Improve bot embeds

  • SimpleEmbed() can work with both interaction.reply() and interaction.editReply()
  • Change help-command-messages text files to embed jsons
  • If string being passed through an embed description is longer than 4096 characters, then split it into multiple embeds

Feature: Command /insights to read the google sheet and compute server stats

Here's the main idea but I don't know how this is going to work yet lol:

  1. Write a python script that takes in a CSV and generates some sort of output file like JSON that shows server stats like the number of tutoring hours etc.
  2. Make an extension that injects another command called /insights that downloads the most recent CSV from google sheets and run the script from part 1. This may or may not block the main thread
  3. Running the script can be done with node's child_process library

Optional logging on server

YABOB can log user interactions and other things it logs on to the console to a channel on each server. By default it won't log anything, you need to use a /set_log_channel [Channel] command.

Auto-leave from notification queue

Students can set a time limit for how long they want to be in the notification queue before they want to leave it.

Useful if a student joins a notification queue, but no-one opens the queue within the time they need help. e.g. they could get pinged that the queue is opened the next day

Feature: Calendar title validation

Currently the schedule message updater parses the string expecting it will be valid.
We can separate this logic into a command that tutors can use before putting their hours in the calendar.
Maybe something like this

function validateCalendarTitle(str: string): boolean {
// use regex here
}

Once the tutors validate their string prompt them to put it on the calendar.
We can just ignore the invalid ones in the actual updater.

Feature: Queue auto clear

From Prof. Butner:

Another thing that I would like to see is the ability to set a time limit for how long a person remains enqueued after the last helper for a queue leaves because quite often I or my TAs will forget to clear the queue when we have to leave.
Something like /set_queue_auto_clear 4. Which would mean that if the queue is not reopened within 4 hours after the last helper closes the queue the queue would be cleared

Update command, function and variable names

Most of them are confusing ๐Ÿซ 
Suggested ones to change:

  • /when_next
  • /notify_me
  • /remove_notif
  • /post_session_msg
  • MsgAfterLeaveVCHandler()
  • ListNextHoursCommandHandler()
  • getQueueHelpersFirstName()
  • getUpcomingHoursTable()
  • UpdateMemberJoinedVC()
  • UpdateMemberLeftVC()
  • getMsgAfterLeaveVC()
  • RefreshCommandHelpChannels()

Complete Redesign of YABOB's Architecture

Objective

Avoid bad JS practices and make YABOB more modular.
Allow developers to easily extend YABOB's functionality by providing them with proper interface.

Most up to date diagram
Current Features

Ongoing Design

  • Better start up error messages

Command Performance Issues

  1. /stop is really slow when using google sheets. This is likely a network issue.
    • Potential fix: Give user feedback when their time is recorded and just let google sheets update finish in the background.

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.