[Audio] disconnect command should check if the user is actually in the VC #6365

Closed
opened 2024-04-22 19:46:10 +02:00 by cool-aid-man · 7 comments
cool-aid-man commented 2024-04-22 19:46:10 +02:00 (Migrated from github.com)

What Red version are you using?

3.5.9

Cog name

Audio

Command name

disconnect

What did you expect to happen?

  • Just like the summon command - the disconnect cmd should also check if the user (who is invoking the command) actually is in the VC before letting them disconnect the bot from the VC - where it's already playing songs along with other humans.
    image

What actually happened?

It lets anyone who is not in the VC, run the command resulting in the bot getting disconnected from the VC, leading to an unpleasant experience.

How can we reproduce this error?

  1. Connect to a VC
  2. Set the vote percentage to 0 by audioset vote 0
  3. Summon the bot to join
  4. Ask any user or <p>mock anyone to run <p>disconnect
    Result - It should let that user x disconnect the bot without having to be there in the VC.

The summon command ONLY works if you are in the VC - likewise, the disconnect should also work if the user is in the VC, regardless of the status of the audioset vote.

Same result with or without the human. (Meaning if the bot is alone or with other users doesn't matter)

Anything else?

N/A

### What Red version are you using? 3.5.9 ### Cog name Audio ### Command name disconnect ### What did you expect to happen? - Just like the `summon` command - the `disconnect` cmd should **also** check if the user (who is invoking the command) actually is in the VC before letting them disconnect the bot from the VC - where it's already playing songs **along with** other humans. ![image](https://github.com/Cog-Creators/Red-DiscordBot/assets/84676543/ef7b2af3-f187-4d9d-8032-395ea67df832) ### What actually happened? It lets anyone **who is not in the VC**, run the command resulting in the bot getting disconnected from the VC, leading to an unpleasant experience. ### How can we reproduce this error? 1. Connect to a VC 2. Set the vote percentage to 0 by `audioset vote 0` 3. Summon the bot to join 4. Ask any user or `<p>mock` anyone to run `<p>disconnect` Result - It should let that user x disconnect the bot without having to be there in the VC. > The `summon` command ONLY works if you are in the VC - likewise, the disconnect should also work if the user is in the VC, regardless of the status of the `audioset vote`. ### Same result with or without the human. (Meaning if the bot is alone or with other users doesn't matter) ### Anything else? N/A
aikaterna commented 2024-04-22 20:14:46 +02:00 (Migrated from github.com)

Sounds like the person that ran disconnect is a priviledged user like a server owner or a mod or admin set through Red.

Sounds like the person that ran disconnect is a priviledged user like a server owner or a mod or admin set through Red.
aikaterna commented 2024-04-22 20:15:53 +02:00 (Migrated from github.com)

Also another thing to note is that the permissions system for audio will not adhere to restrictions if there is no one in the channel or if they are alone.

Also another thing to note is that the permissions system for audio will not adhere to restrictions if there is no one in the channel or if they are alone.
cool-aid-man commented 2024-04-23 06:53:29 +02:00 (Migrated from github.com)

Sounds like the person that ran disconnect is a priviledged user like a server owner or a mod or admin set through Red.

Hi aika, I can confirm that this is not the case here,

  • I joined as server owner + with the bot in a VC - so the bot is not alone.
  • The user neither has the moderator nor admin privilege not even set by the set command - In fact the user doesn't have any perms besides send_message.
  • The bot doesn't have permissions override set by permissions cog, I had cleared all the permissions just to be extra safe.
  • There's no DJ role set through the audioset dj.
  • Audioset vote is set to 0 audioset vote 0 (If the audioset vote is set to any percentage then it would have asked the user - "There are other people listening - vote to skip instead.")
> Sounds like the person that ran disconnect is a priviledged user like a server owner or a mod or admin set through Red. Hi aika, I can confirm that this is not the case here, - I joined as server owner + with the bot in a VC - so the bot is not alone. - The user neither has the moderator nor admin privilege not even set by the `set` command - In fact the user doesn't have any perms besides send_message. - The bot doesn't have permissions override set by `permissions` cog, I had cleared all the permissions just to be extra safe. - There's no `DJ` role set through the `audioset dj`. - Audioset vote is set to 0 `audioset vote 0` (If the audioset vote is set to any percentage then it would have asked the user - "There are other people listening - vote to skip instead.")
CosmicHikari commented 2024-05-30 04:16:12 +02:00 (Migrated from github.com)

I also have this issue. I can summon my Red instance to a voice channel, and my alt account (with only the @\everyone role) can disconnect the instance despite the user not being in the voice channel.

Edit: clarification, accidental ping, the sky is now on fire...

I also have this issue. I can `summon` my Red instance to a voice channel, and my alt account (with only the @\everyone role) can `disconnect` the instance despite the user not being in the voice channel. Edit: clarification, accidental ping, the sky is now on fire...
CosmicHikari commented 2024-05-30 04:18:28 +02:00 (Migrated from github.com)

image

image

![image](https://github.com/Cog-Creators/Red-DiscordBot/assets/16886014/d4a569db-90ed-404b-b33c-94f4db77850a) ![image](https://github.com/Cog-Creators/Red-DiscordBot/assets/16886014/baa008cb-c73d-4d46-a914-a6ff56ea9f9e)
BenCos17 commented 2024-05-31 22:56:45 +02:00 (Migrated from github.com)

can confirm that it's the same for me also

can confirm that it's the same for me also
Jackenmen commented 2026-05-21 01:13:00 +02:00 (Migrated from github.com)

I'm not sure checking that the user is in the VC is the right thing to do here - I think it would make more sense to check whether the user can join (and maybe speak in? I'm not sure that would be consistent with the rest of the Audio commands though) the channel. If they can, they can easily just join the channel and run [p]disconnect anyway, so it just forces them to do an extra step for no reason.
I guess whatever the rules for [p]stop are, should apply to [p]disconnect.

I'm not sure checking that the user is in the VC is the right thing to do here - I think it would make more sense to check whether the user can *join* (and *maybe* speak in? I'm not sure that would be consistent with the rest of the Audio commands though) the channel. If they can, they can easily just join the channel and run `[p]disconnect` anyway, so it just forces them to do an extra step for no reason. I guess whatever the rules for `[p]stop` are, should apply to `[p]disconnect`.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
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
Mrcoolgamer11/Red-DiscordBot#6365
No description provided.