Difference between revisions of "Event Bot"

From UOAF Codex
Jump to navigation Jump to search
m
m
 
Line 13: Line 13:
 
The bot will look up the signup sheet for this event in the Google Drive (Filename "Signup <event number>"). If exactly one sheet is found, the event is started and the bot will go to ''slotting mode'' for a duration of 15 minutes.
 
The bot will look up the signup sheet for this event in the Google Drive (Filename "Signup <event number>"). If exactly one sheet is found, the event is started and the bot will go to ''slotting mode'' for a duration of 15 minutes.
  
In slotting mode, the bot will continually compare the list of Discord users in the UOAF Briefing Room with the user names in the signup sheet. Missing users ("no shows") will be colored red in the signup sheet. Users which have joined the briefing room and are not entered in the signup sheet ("unslotted users") will be mentioned in a discord message by the bot.
+
In slotting mode, the bot will continually compare the list of Discord users in the UOAF Briefing Room with the user names in the signup sheet. For each user, the Discord "display user name" will be compared (if it is not set, the unique Discord username will be used).
 +
 
 +
Missing users ("no shows") will be colored red in the signup sheet. Users which have joined the briefing room and are not entered in the signup sheet ("unslotted users") will be mentioned in a discord message by the bot.
  
 
The goal of the moderator should be to make sure that all participants of the event are slotted. Only slotted users will later receive the DM with the survey link.
 
The goal of the moderator should be to make sure that all participants of the event are slotted. Only slotted users will later receive the DM with the survey link.

Latest revision as of 15:24, 21 June 2023

Event Bot logo.png

https://github.com/UOAF/eventbot

Purpose: facilitate the organization of UOAF BMS events by automating routine tasks with an easy to use Discord bot.

Usage

Note: In order to use the bot, it is not necessary for the bot to join any channel. Commands to the bot can be issued by any UOAF member with the roster role. Suggested channels to issue commands are the Briefing Room, #bot-commands or #bot-testing.


Starting an event

/start-event <event number>

The bot will look up the signup sheet for this event in the Google Drive (Filename "Signup <event number>"). If exactly one sheet is found, the event is started and the bot will go to slotting mode for a duration of 15 minutes.

In slotting mode, the bot will continually compare the list of Discord users in the UOAF Briefing Room with the user names in the signup sheet. For each user, the Discord "display user name" will be compared (if it is not set, the unique Discord username will be used).

Missing users ("no shows") will be colored red in the signup sheet. Users which have joined the briefing room and are not entered in the signup sheet ("unslotted users") will be mentioned in a discord message by the bot.

The goal of the moderator should be to make sure that all participants of the event are slotted. Only slotted users will later receive the DM with the survey link.

Only one event can be active at the same time.


Restarting Slotting

/slot <optional: duration in minutes>

The bot will end slotting mode automatically. However, it is sometimes necessary to update the slotting of the event (late-comers, drop-outs, ...). If this command is used without the duration argument, the slotting is updated exactly once. Otherwise, the slotting will run continuous for the given duration.

Note: Make sure that all participants have joined the briefing room when using this command because any previous slotting will be overwritten.


Ending an event

/end-event

This will end the current event and send out the survey. This happens automatically: the bot will copy an existing Google Forms Survey and renaming it to "UOAF <event number> Post Event Survey". The survey's description will also be updated with the event number.

After the survey is created, the bot will send out the survey text and the survey participation link to each slotted participant of the event.

Additionally, the survey is queued to be entered into the "UOAF BMS Engagemenet Data" sheet. This will happen 72 hours after the event without any further user interaction. The bot will also post the survey results to the "metrics-and-event-performance" channel.

Note: Since the current Google API does not allow for the closing of surveys, survey forms can be open indefinitely.

Event data

Most of the event data in the BMS Engagement sheet can be deducted from the event and its survey. However, additional data is gathered as follows:

  • Package commander(s) are queried from the signup sheet (checkboxes)
  • Fraggers are queried from the event-list channel - the event is looked-up by its number and the :Fragger: reactions are used
  • The moderator is the Discord user who started the event via the bot command
  • "Sent Survey out" and "Metrics Collector" are both set to "UOAF Eventbot"

Displaying & refreshing survey data

/survey <event number>

After a survey has been entered into the BMS Engagement sheet, its data can be displayed in the chat and refreshed. This command will look-up the event in the Engagement sheet and find its matching survey in Google Forms. It will then refresh the event data with the most current answers of the survey and output the data in the Discord channel where the command was issued.


Displaying the bot status

/status

Shows a brief status of the current event (if applicable) and the pending event surveys.


Installation & Deployment

The bot requires the Discord token to be in an environment variable DISCORD_TOKEN, so make sure you set it by using export DISCORD-TOKEN="foo".

The Google credentials are located in the credentials.json file. A log is generated in uoaf-eventbot.log.

To install the dependencies, it is suggested to create a virtual environment and then run pip3 install -r requirements.txt