diff options
| author | Harry Jenkins <[email protected]> | 2024-08-28 16:44:18 +1000 |
|---|---|---|
| committer | Harry Jenkins <[email protected]> | 2024-08-28 16:44:18 +1000 |
| commit | dede552ddd66e528b96395e05c6baa10d94aed51 (patch) | |
| tree | ba7690171b949197233d4615af0c4915efbde74d /src/commands/config.ts | |
| parent | 1e17b94321744ffbe4a6176a900286a834c952d1 (diff) | |
| parent | a87078c2ada84adabc8d9bb5b527feec6490e513 (diff) | |
| download | muse-dede552ddd66e528b96395e05c6baa10d94aed51.tar.xz muse-dede552ddd66e528b96395e05c6baa10d94aed51.zip | |
Merge branch 'TiagoGrosso-configurable-queue-page-size'
Diffstat (limited to 'src/commands/config.ts')
| -rw-r--r-- | src/commands/config.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/commands/config.ts b/src/commands/config.ts index f866e82..91b2578 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -57,6 +57,15 @@ export default class implements Command { .setMaxValue(100) .setRequired(true))) .addSubcommand(subcommand => subcommand + .setName('set-default-queue-page-size') + .setDescription('set the default page size of the /queue command') + .addIntegerOption(option => option + .setName('page-size') + .setDescription('page size of the /queue command') + .setMinValue(1) + .setMaxValue(30) + .setRequired(true))) + .addSubcommand(subcommand => subcommand .setName('get') .setDescription('show all settings')); @@ -171,6 +180,23 @@ export default class implements Command { break; } + case 'set-default-queue-page-size': { + const value = interaction.options.getInteger('page-size')!; + + await prisma.setting.update({ + where: { + guildId: interaction.guild!.id, + }, + data: { + defaultQueuePageSize: value, + }, + }); + + await interaction.reply('👍 default queue page size updated'); + + break; + } + case 'get': { const embed = new EmbedBuilder().setTitle('Config'); @@ -185,6 +211,7 @@ export default class implements Command { 'Auto announce next song in queue': config.autoAnnounceNextSong ? 'yes' : 'no', 'Add to queue reponses show for requester only': config.autoAnnounceNextSong ? 'yes' : 'no', 'Default Volume': config.defaultVolume, + 'Default queue page size': config.defaultQueuePageSize, }; let description = ''; |
