JackDotJS / OptiBot

(DISCONTINUED) The original Discord bot for OptiFine. https://discord.gg/3mMpcwW
1 stars 0 forks source link

Make vc text channels only visible to people in the vc #261

Closed LiamDun closed 3 years ago

LiamDun commented 3 years ago

I've seen this on a different server and not sure how hard it'll be to implement but it basically gives you a role while you're in the vc that gives you access to the vc text channel, would definitely prevent people just randomly chatting there that aren't in a vc

Just not sure how this would work with both the vip vc and normal vc

Jorkles commented 3 years ago

It's possible, seen it done before. Moderators would need a permission to see into those chats at all times if this was implemented.

IMS212 commented 3 years ago

no they wouldn't? only the normal person would, moderators could just have access at all times

LiamDun commented 3 years ago

Yeah obviously staff would always be able to see that channel

MrCheeze446 commented 3 years ago

we'd just need to make a vc role and make it so they can see into the channel, not sure how well detecting people in a vc with a bot is tho

LiamDun commented 3 years ago

Only problem I really see is we have both vip vc and normal vc so would it be possible to implement this system without making two roles for both of the vcs

Deviouslrd commented 3 years ago

You just need to listen for a member joining a specific voice channel using a special event, i myself havent gotten it working in my own bot, but you'll want to detect a change in voice channel id to then give the role/perms. see: https://stackoverflow.com/questions/56396946/how-to-give-permissions-for-text-channel-when-user-joins-vc-and-revoke-when-use

since you can go by ids, you can give the vc text channel based on if you join the vip/normal vc, take their ids and compare against the rest. probably made no sense, but hopefully you get the gist of what im saying

LiamDun commented 3 years ago

Yeah but wouldn't that give non donators access to vip vc text?

Deviouslrd commented 3 years ago

if you were doing it for specifics, you could handle it by user rather than role. A role would mean you would get access to both UNLESS you had 2 seperate roles for the vc If you did it by user, and just manually modified the user's permissions to the vc-text channel, then only they can see the relevant vc-text while they are in the vc.

LiamDun commented 3 years ago

Yeah that sounds better since people won't get the role, only problem is I feel like discord would have crazy rate limits for that. I might be wrong though

Deviouslrd commented 3 years ago

Rate limits would only be a factor here if the person spammed joining and leaving. If they just entered and stayed, it wouldn't be of any issue. On leave, if everyone left at the same time, then that would need to likely be rate limit protected

JackDotJS commented 3 years ago

this whole idea is awful due to ratelimiting. people can join/leave channels incredibly fast and last time i checked, the bot can only update channels up to 2 times per 10 minutes. the same issue applies to adding/removing roles, though i dont know what the ratelimit to that is.

there's no simple way to track if someone is rapidly leaving/joining a channel. frankly i really do not want this headache.