Multiple meeting lobbies and beta-gated features (3.5.2)
- /meeting add-lobby, remove-lobby, lobbies: up to 10 lobbies per server, capped in the database - Deleted voice channels are dropped from the lobbies - Beta features: registered only in the beta server and usable only with the Beta Tester role (BETA_GUILD_ID, BETA_ROLE_ID); fails closed - /beta (bot owner only) shows how beta access is set up Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
1 parent
136377d81a
commit
a364435bab
15 files changed
+789
-52
No files matched your search
@@ -2,6 +2,8 @@ package commands
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"velox-bot/internal/beta"
|
||||
"velox-bot/internal/commands/betacmd"
|
||||
"velox-bot/internal/commands/config"
|
||||
"velox-bot/internal/commands/fun"
|
||||
"velox-bot/internal/commands/help"
|
||||
@@ -11,8 +13,8 @@ import (
|
||||
cmdmusic "velox-bot/internal/commands/music"
|
||||
"velox-bot/internal/commands/projects"
|
||||
"velox-bot/internal/commands/schedule"
|
||||
cmdtickets "velox-bot/internal/commands/tickets"
|
||||
cmdsecurity "velox-bot/internal/commands/security"
|
||||
cmdtickets "velox-bot/internal/commands/tickets"
|
||||
"velox-bot/internal/commands/timezone"
|
||||
"velox-bot/internal/music"
|
||||
|
||||
@@ -79,6 +81,24 @@ var handlers = map[string]func(s *discordgo.Session, i *discordgo.InteractionCre
|
||||
"unlock": cmdsecurity.UnlockHandler,
|
||||
}
|
||||
|
||||
// BetaCommands are the beta features' slash commands. They're registered in
|
||||
// the beta server only, so nobody else even sees them, and each handler is
|
||||
// wrapped so it runs only for members with the Beta Tester role (see the beta
|
||||
// package). To put a feature in beta, add it with RegisterBeta instead of to
|
||||
// AllCommands and handlers; to release it, move it there.
|
||||
var BetaCommands = []*discordgo.ApplicationCommand{betacmd.Beta}
|
||||
|
||||
func init() {
|
||||
// /beta itself is open to the whole beta server (see betacmd).
|
||||
handlers[betacmd.Beta.Name] = betacmd.Handler
|
||||
}
|
||||
|
||||
// RegisterBeta adds a slash command that only beta testers can use.
|
||||
func RegisterBeta(cmd *discordgo.ApplicationCommand, h func(s *discordgo.Session, i *discordgo.InteractionCreate)) {
|
||||
BetaCommands = append(BetaCommands, cmd)
|
||||
handlers[cmd.Name] = beta.Gate(h)
|
||||
}
|
||||
|
||||
func HandleInteraction(s *discordgo.Session, i *discordgo.InteractionCreate) {
|
||||
switch i.Type {
|
||||
case discordgo.InteractionApplicationCommand:
|
||||
|
||||
Reference in new issue
Block a user