Temporary voice channel functionality - #232
Conversation
…ownership, and /voice First slice of the MEE6 migration (7Cav#100): - multiple hardcoded hubs, each with per-hub user limit, bitrate, and grace - owner overwrite grants ManageChannels, MoveMembers, and ManageRoles so owners can rename, limit, lock, hide, and block - interim ownership by status role, then rank role, then lowest user ID, restored when the creator returns - role-based naming: rank from the rank role, name from the nickname; tolerates the 0/O typo and keeps multi-word names - numbering, per-user cap with a hub-named notice, grace cleanup, restart orphan sweep, and an audit log - /voice block and /voice permit owner commands
e48100f to
0edfbb1
Compare
|
Note: this and #229 both touch main.go. This PR only adds an 8-line block right after registry := commands.NewRegistry() (registering the temp-VC handlers and /voice); whichever of the two merges second should be a trivial rebase. |
|
@HWqs Status update for you here. I went and did the MEE6 audit that should have happened before you wrote a line of this. Start with the part you got right. There are 14 hubs live in production. My triage note on #100 called multi-hub YAGNI and put it out of scope, and the review I ran afterwards repeated that back as scope creep. Both wrong. You built the hub table anyway, and it's the piece of the design that turned out to match what the 7Cav discord actually runs. Now the part that's mine. My triage said the creator gets I've sent questions up the chain, covering the permission model, which commands should exist, whether the settings ought to be uniform, and what the channel name actually needs in it. Four things are genuinely undecided until that comes back, and I'd rather you didn't spend time on any of them:
None of that is a judgement on how you built any of it. The lifecycle engine underneath, spawn on hub join, occupancy tracking, the grace reap, the restart sweep, the manager seam, is the hard part and it's sound. I'd expect all of it to survive whatever we decide. If you want to work some fixes while we wait, these hold no matter the answers to the above:
The status-class split is generic and worth reusing: 403 is missing permissions, 5xx and transport are real system faults, any other 4xx is Discord rejecting the request. What you want is Unknown Channel untracking the channel quietly, while a 403 keeps it tracked so it still counts against the owner's cap. Either give this file its own 404 branch or add a channel-aware arm to the shared one, whichever you think reads better. And yes, a helper that generic shouldn't be living in a file named after warden, but moving it drags warden's test file along with it, so not in this PR. How often any of this bites depends on the permission answer, since that decides whether members can hand-delete their own channels at all. One thing worth building ahead of the answers. Right now You can bodge it by making The handler moves with it. The chosen action becomes I'd do this now because block and permit is close to the only command set where the flat shape works at all, and it almost certainly isn't the set we land on. That's also the moment to settle your open question 4, about registering Watch the ordering if you do it. If you'd rather park it till we get the full picture, that is fair too. |
|
The scope of this has changed materially after conversations with genstaff, and in a way that I'm not willing to hand off and I want to instead build myself. That said, what you have here is good foundational work for it, so instead of closing this I'm going to build off of it to get where we need to be for what is required. |
Closes #100. "Join to create" temporary voice channels, plus owner-management controls.
What this does
A member who joins a configured hub voice channel gets a personal voice channel spawned
under that hub's category and is moved into it. The channel is auto-deleted a short grace
period after it empties. Everything runs off gateway events (
VOICE_STATE_UPDATE,GUILD_CREATE,CHANNEL_UPDATE). Nothing is persisted. Discord permission overwrites are theonly durable ownership marker.
Included
empty-channel grace period).
ManageChannels,MoveMembers, andManageRoles, so they can rename, set a user limit, kickor move occupants, and lock, hide, or block members.
highest-priority member present (status role first; e.g. general staff, MP, platoon staff,
then rank role, then lowest user ID) and is handed back if/when the creator returns.
(authoritative), the name (Last.F) comes from the nickname with the rank token and trailing
callsigns stripped. It tolerates the
0/Otypo (W01becomesWO1).restart orphan sweep that reaps empty temp channels and adopts occupied survivors.
interim handoff). Each line is Zulu-timestamped.
/voicecommand group:/voice block @user(denyConnectand disconnect them if present)and
/voice permit @user.Decisions already made for now
0/Onormalized (W01,C0L); multi-word names kept (only quoted, bracketed,LOA, or emoji trailers are dropped)./voicecovers block and permit. Rename, limit, lock, and hide are done through Discord's native channel UI, which theManageRolesgrant enables.Decisions still open
/voice? Optionallimit,lock,hide,rename,claimsubcommands. Owners canalready do these natively via their granted perms, so they would be convenience only.
/voice, and multi-hubconfig are load-bearing.
/voiceregistration. It is registered inmain.gofromStartTempVC's return value (itneeds the live runtime instance) rather than in
NewRegistry(). OK?Deployment notes
GuildVoiceStatesintent, already covered byIntentsAllWithoutPrivileged.Connect,Manage Channels,Manage Roles,View ChannelandMove Members.Nickname to channel-name resolution
Rank is taken from the rank role when available; the nickname only supplies the name. When no
rank role is held, the rank parsed from the nickname is used as a fallback, per this table:
CPL Smith.JCPL Smith.J's Channel1LT.Laui.M1LT Laui.M's Channel1LT. Laui.M1LT Laui.M's ChannelCW3.Rivera.TCW3 Rivera.T's ChannelW01.Laui.MWO1 Laui.M's Channel0/Otypo toleratedC0L.Smith.JCOL Smith.J's Channel0/Otypo tolerated1LT.Laui.M "Bobo"1LT Laui.M's Channel1LT.Laui.M LOA1LT Laui.M's ChannelLOAsuffix dropped1LT.Laui.M <cadre>1LT Laui.M's ChannelCPL Smith.J 🐎CPL Smith.J's Channelcpl smith.jwCPL Smith.JW's ChannelCPLSmith.JCPLSmith.J's ChannelCPL-Smith.JCPL-Smith.J's ChannelCAPT.Smith.JCAPT.Smith.J's ChannelXO Smith.JXO Smith.J's ChannelTrooper's ChannelOnly
.,., or a space work as the rank/name separator; a hyphen, underscore, or missingseparator falls through to the raw nickname. Once rank roles are configured, the rank comes
from the role and the nickname's rank text is ignored entirely.