Skip to content

Latest commit

 

History

History
203 lines (129 loc) · 6.25 KB

README.rst

File metadata and controls

203 lines (129 loc) · 6.25 KB

DiscordLogo BOB

The "Better" Office Hours Bot

PurposeOverviewQuick StartDocsLicense

Purpose

With the need for online learning becoming increasingly higher, efficient means of reaching educators has become extremely important. We implemented a discord bot to help instructors automate the process of their Office Hours through Discord.

We created this bot with the goal of allowing students to effectively communicate with their instructors, with the option to be able to ask their peers for help while they wait.

Overview

BOB is a server managment automation bot. This means that tasks like queue management and notifying students are handled by BOB

BOB is a self-hotsted bot - meaning that you will need to host and maintain your own instance. See Quick Start to get started.

The standard OH-Session protocol that we follow:

> Helpers refer to Instructors, TAs, and Tutors

  1. Helpers Opens Queues for which they help for
  2. Students enter the queue of their choice
  3. Helpers issues a dequeue command
  4. Helpers close their queues when their OH-Session is over
  5. Multiple Helpers can help for the same queue. A Queue will only close if there are no helpers for that queue.

Waiting Queue System

BOB implements a simple first come first serve queue where student are allowed to enter and leave the queue whenever they like while OH is being held.

Server Template: TODO

BOB makes use of Discord’s Server Template feature

There are three roles in the BOB server

  • Admin - total control of bot functionality and server interfaces
  • Instructor - control over OH sessions and locked channels
  • Student - ability to interface with OH-Queue

Commands

BOB commands have access level based on sender roles

  • /start - Access Role: [Admin, Helper]
    • Open queues that the Helper is assigned to help for
  • /stop - Access Role: [Admin, Helper]
    • Close the OH-queue, stop students from entering the queue
    • Students that were in the queue before closing will still be regisitered for OH
  • /clear (queue_name) (all) - Access Role: [Admin, Helper]
    • Empties a queue of students
    • Option queue_name : Clears only the queue queue_name
    • Option all : Clears all queues
  • /enqueue [queue_name] (user) - Access Role: [Admin, Helper, Student]
    • Adds sender to the back of the queue queue_name
    • Option user : Adds user to the end of the queue queue_name. Access Role: [Admin, Helper]
  • /leave - Access Role: [Admin, Helper, Student]
    • Removes sender from the queue in which they are in
  • /next (queue_name) (user) - Access Role: [Admin, Helper]
    • Removes next student from the sender's queue(s) and sends them an invite to the voice channel.
    • Option queue_name : Removes a student from a particular queue
    • Option user : Removes a particular user from the queue(s)
  • /announce [message] (queue_name) - Access Role: [Admin, Helper]
    • Sends a messeage message to all of the students in the sender's queues
    • Option queue_name: Sends the message to only those in queue_name
  • /list-helpers - Access Role: [Admin, Helper, Student]
    • Shows a list of Helpers that are currently helping, the queues for which they help for and how long it's been since they started helping
  • /queue add [queue_name] - Access Role: [Admin]
    • Creates a new category with the name queue_name and creates a #queue and #chat text channels within it
  • /queue remove [queue_name] - Access Role: [Admin]
    • Deletes the category with the name queue_name, if it exists, and the channels within it

Requirements

Quick Start

Instantiate an instance of a server in Discord

Follow discord.py docs on creating and adding a bot to your server.

Clone the source code

git clone https://github.com/ECS-OH-Bot/BOB && cd BOB

Follow the instructions here for obtaining a token for your instance of the Bot

Make a .env file in the current directory with the following format:

BOB_GOOGLE_SHEET_ID=[Insert Google Sheets Token ID here]
BOB_APP_ID=[Insert Discord Application ID here]
BOB_BOT_TOKEN=[Insert Discord BOT Token here]

Also create a .json file in the current directory named gcs_service_account_key.json which you get get from the Google Cloud website

Run the following command to setup the bot locally

npm run build

If the build succeeds, run the next command to run the bot

npm run start

npm run test and npm run lint are also available. run npm run at anytime to view the available npm commands

Adjust the role hierarchy.

For security/privacy purposes, bot/scripts are not allowed to adjust themselves upward the role hierarchy. This must be done by hand to allow features of the bot.

./assets/adjustRole.gif

Run the script to start up the bot

./run{ENV_FILE_NAME}.sh

License

Released under the GNU GPL v3 license.

Copyright (C) 2020 Grant Gilson, Noah Rose Ledesma, Stephen Ott