feat(voice): support several trigger channels with their own category
A server needs one "create your own room" channel per theme, which a single trigger id could not express. Triggers are now stored as a list, each with its own home category, name template and default limit. Joining a trigger creates the channel at the bottom of that trigger's category, and a member keeps one channel per trigger instead of one room for the whole server. Triggers declared by the single-trigger version and CHANNEL_VOICE_TRIGGER_ID still work as fallbacks, so no server has to be reconfigured.
This commit is contained in:
8 files changed
+787
-112
No files matched your search
@@ -62,3 +62,11 @@ export function countVoiceChannels(guildId) {
|
||||
.get(guildId);
|
||||
return row.count;
|
||||
}
|
||||
|
||||
/** Channels still alive for one trigger, used by the configuration embed (M14-T01). */
|
||||
export function countVoiceChannelsByTrigger(triggerId) {
|
||||
const row = getDatabase()
|
||||
.prepare('SELECT COUNT(*) AS count FROM voice_channels WHERE trigger_id = ?')
|
||||
.get(triggerId);
|
||||
return row.count;
|
||||
}
|
||||
Reference in new issue
Block a user