pinano-discord / Pinano-Discord-Bot

A Discord bot for the Pinano guild
MIT License
9 stars 11 forks source link

Server-muted users leaving locked room retains PR chat privileges #61

Closed pianiststickman closed 5 years ago

pianiststickman commented 5 years ago

Repro:

  1. User A locks room with User B inside. User B consequently becomes server muted.
  2. User B leaves channel.

Console logs error trying to read locked_by of undefined, and B retains PR chat privileges. The reason for this is because the voiceStatusUpdate handler attempts to find out if we've joined an unlocked room and needs to unmute us, and attempts to do this regardless of whether or not we're actually in a channel or not. Bailing on the null dereference causes the PR-chat permission update (which happens after the unmute check) not to occur.