cannawen / dota-gsi-discord-bot

Use Dota 2's Game State Integration API to make helpful announcements in a discord voice channel
MIT License
5 stars 2 forks source link

[chore] have bot auto-join discord instead of using /coachme command #122

Closed cannawen closed 1 year ago

cannawen commented 1 year ago

GIVEN A student has done a /coachme in a guild before, set their last known guild as their "default guild"

WHEN The student starts a dota game AND The student is in a voice channel in their default discord guild AND A coaching session has not been started yet

THEN The bot should auto-connect to the channel and start coaching without any user interaction

Caveat: How to handle if two students are in the same channel? --> race condition; whoever sends the first GSI event will be in control of the "public" audio settings


A student can turn autoconnect on or off using the /autoconnect True or /autoconnect False commands (default to on)

cannawen commented 1 year ago

Slight bug, hopefully no one will run into:

  1. join voice channel on a guild
  2. /coachme
  3. /stop
  4. send GSI events to the bot --> Works as expected: bot auto-connects to your channel
  5. /autoconnect False
  6. /stop
  7. send GSI events to bot --> Works as expected: bot does not auto-connect to your channel
  8. /autoconnect True
  9. send GSI events to the bot

Expected: bot auto-connects Actual: bot does not auto-connect

This is probably because some state is stale. wontfix: I don't think it's going to be a common use case; we can add some documentation to the instructions that you should do a /coachme after changing your /autoconnect settings

cannawen commented 1 year ago

Weird UX where private coaching needs to be started AFTER the bot joins the discord.

If you start private coaching from the website, the guild and channel id variables get set to null and the bot does not auto-connect ... re-opening

cannawen commented 12 months ago

Now if there is already a default guild set, doing a /coachme will not reset the default guild. Need to manually change the default guild by doing a slash command