Voice and Threads are coupled too much #39

Closed
opened 2025-07-21 11:30:22 +09:00 by AnthonyKwon · 1 comment
Owner

Expected Behavior

Even VC join and Thread creation state is desynchronised, Bot should work without issue.

Actual Behavior

When VC and Thread state is desynchronised, bot starts to act weird.
(I'll assume as Thread failed to create, which happens most for this issue)

  • /join: Bot tries to leave VC as DiscordVoice object exists, and calls threadEvent.remove(). However, as thread haven't created, threadMap.get() of DiscordThread object returns undefined. So application throws an TypeError.
  • /leave: Bot tries to check existance of both VC and Threads, but will fail as thread does not exist. So bot will just show "VC not joined" message.

Possible Solution

Voice and Thread codes are coupled too much overall, we should decouple it.

## Expected Behavior Even VC join and Thread creation state is desynchronised, Bot should work without issue. ## Actual Behavior When VC and Thread state is desynchronised, bot starts to act weird. (I'll assume as Thread failed to create, which happens most for this issue) - `/join`: Bot tries to leave VC as `DiscordVoice` object exists, and calls `threadEvent.remove()`. However, as thread haven't created, `threadMap.get()` of `DiscordThread` object returns `undefined`. So application throws an `TypeError`. - `/leave`: Bot tries to check existance of both VC and Threads, but will fail as thread does not exist. So bot will just show "VC not joined" message. ## Possible Solution Voice and Thread codes are coupled too much overall, we should decouple it.
AnthonyKwon added this to the 4.0.0 milestone 2025-07-21 11:30:22 +09:00
Author
Owner

Closing as fixed by #43.

Closing as fixed by #43.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: AnthonyKwon/chattybot#39
No description provided.