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
@@ -30,11 +30,15 @@ describe('command modules', () => {
|
||||
});
|
||||
|
||||
it('only overrides the access of declared subcommands', async () => {
|
||||
/** Top-level subcommands and those nested in a subcommand group (M14). */
|
||||
const subcommandNames = (options = []) =>
|
||||
options.flatMap((option) =>
|
||||
option.type === 1 ? [option.name] : option.type === 2 ? subcommandNames(option.options) : [],
|
||||
);
|
||||
|
||||
for (const command of await loadCommands()) {
|
||||
if (!command.subcommandAccess) continue;
|
||||
const subcommands = (command.data.toJSON().options ?? [])
|
||||
.filter((option) => option.type === 1)
|
||||
.map((option) => option.name);
|
||||
const subcommands = subcommandNames(command.data.toJSON().options);
|
||||
for (const name of Object.keys(command.subcommandAccess)) {
|
||||
assert.ok(subcommands.includes(name), `/${command.data.name} ${name} is not a subcommand`);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user