CyberTA was designed in the COVID-19 pandemic to help Operating Systems TAs with their queue based office hours. The inspiration came from other twitch.tv bots that allowed users to be put in a queue for games. It uses Discord.js and Heroku apps to create a 24/7 bot that monitors multiple text-channels.
!ping
- simple test that responds "pong"!afk
- enables/disables yourself as away from keyboard (AFK). Useful if you need to go grab something quick and will be right back!next
- adds a user to queue and responds with user's position in queue, (optional:!next + 'issue description'
),!queue
- view the queue w/ user name, issue description, how long they've been waiting!undo
- quickly undo the next call that put the user in queue!remove
- takes a index parameter (i:e remove 2), removes user from queue at certain index, alerts user that TA is ready, deletes user's !next call!ready
- removes user from top of the queue, alerts user that the TA is ready, deletes !next call from top user, tells time spent on previous team (if available)!online
- enables !next command, sets TA to online!offline
- disables !next command, sets TA to offline!clear
- clears the queue and deletes allnext
messages that were in the queue!help
- provides list of commands and their functions
CyberTA uses the following tech:
- Discord - Based communication software
- Discord.js - chat bot language
- Heroku - used for hosting the bot
These instructions are for installing CyberTA to a Heroku application. You will need a GitHub, Heroku, and discord developer account as well as manage server permissions to a Discord server.
- Fork this repository to your GitHub account, or an account you have access to.
- Create a new app, call it whatever you'd like (only you will see this).
- For deployment method, choose Github, search for your fork and connect.
- Once it has connected successfully a new section called "Manual deploy" will appear, deploy master to pull the code from GitHub.
- The Heroku instance will now install dependencies, and you will need to configure the app.
- Goto https://discord.com/developers/applications.
- Create a new application (again, call it whatever you'd like, this is for you).
- Once you have created your app, add a bot and copy the bot token.
- If you'd like to change the username field now, this is what will your bot will be called.
- Go back to your Heroku app settings, under 'Settings', reveal config vars.
- Create a new variable
BOT_TOKEN
and paste your copied token. - On your Discord server right click the channel you wish to designate for the TA's to manage the queue (You may need to hold shift) and click 'Copy ID'.
- This ID will be the
TA_CHANNEL
config var on Heroku. - Do the same for the office hours channel creating a
OFFICE_HOURS
config var with the corresponding ID on Heroku. - To add this Bot to your server, go to https://scarsz.me/authorize. You can find your client Id from the Discord application settings, under 'General Information'.
- Choose the server you'd like to deploy the bot to, and 'Authorize'.
- Back on Heroku, under the 'Resources' section you should now have two Dynos a web and a node worker. Disable the web and enable the node worker.
- This will restart the application and your bot should now be functional.
These instructions assume you have your own hosting platform (or your own computer) and node.js installed. You only need a discord developer account, but a GitHub account is recommended to receive future updates.
- Clone / Download this repo to the local directory of your hosting platform (this can be your local machine) of choice.
- Inside the repo directory run the command
npm install
to install dependencies. - Create a file named
.env
in this directory following the example below. (This will contain secret application-specific environment variables, do not push upstream!) - Goto https://discord.com/developers/applications.
- Create a new application (again, call it whatever you'd like, this is for you).
- Once you have created your app, add a bot and copy the bot token.
- If you'd like to change the username field now, this is what will your bot will be called.
- Paste your bot token into the
<BOT_TOKEN>
placeholder in the example file. - On your Discord server right click the channel you wish to designate for the TA's to manage the queue (You may need to hold shift) and click 'Copy ID'.
- This ID will be the
<TA_CHANNEL>
value in the.env
file example. - Do the same for the office hours channel filling in
<OFFICE_HOURS>
with the corresponding ID. - To add this Bot to your server, go to https://scarsz.me/authorize. You can find your client Id from the Discord application settings, under 'General Information'.
- Choose the server you'd like to deploy the bot to, and 'Authorize'.
- Back on your hosting platform, run the command
npm start
from the repo directory.
BOT_TOKEN=<BOT_TOKEN>
TA_CHANNEL=<TA_CHANNEL>
OFFICE_HOURS=<OFFICE_HOURS>
MIT