From 0912d957918cb93b0d0607d305fd9d92c1f1cce5 Mon Sep 17 00:00:00 2001 From: Tiago Grosso Date: Sat, 24 Aug 2024 23:08:05 +0100 Subject: feat: add setting for default queue page size --- src/commands/config.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/commands/config.ts') diff --git a/src/commands/config.ts b/src/commands/config.ts index f866e82..c9aa0e3 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -56,6 +56,15 @@ export default class implements Command { .setMinValue(0) .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(50) + .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 = ''; -- cgit v1.2.3 From 8e7e12c8dfa39d4ce779b8fdcbdfd0cfe7425269 Mon Sep 17 00:00:00 2001 From: Tiago Grosso Date: Tue, 27 Aug 2024 11:11:43 +0100 Subject: fix: limit queue size to 30 --- src/commands/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/commands/config.ts') diff --git a/src/commands/config.ts b/src/commands/config.ts index c9aa0e3..91b2578 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -63,7 +63,7 @@ export default class implements Command { .setName('page-size') .setDescription('page size of the /queue command') .setMinValue(1) - .setMaxValue(50) + .setMaxValue(30) .setRequired(true))) .addSubcommand(subcommand => subcommand .setName('get') -- cgit v1.2.3 From b42f27eba9db787c1986e9d2146f742157905e91 Mon Sep 17 00:00:00 2001 From: Hazzajenko Date: Fri, 1 Nov 2024 17:36:01 +1100 Subject: Added commands to set whether to reduce the volume when people speak and to set the target volume. --- src/commands/config.ts | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/commands/config.ts') diff --git a/src/commands/config.ts b/src/commands/config.ts index 91b2578..01d9fe9 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -40,6 +40,22 @@ export default class implements Command { .setName('value') .setDescription('whether bot responses to queue additions are only displayed to the requester') .setRequired(true))) + .addSubcommand(subcommand => subcommand + .setName('set-reduce-vol-when-voice') + .setDescription('set whether to turn down the volume when people speak') + .addBooleanOption(option => option + .setName('value') + .setDescription('whether to turn down the volume when people speak') + .setRequired(true))) + .addSubcommand(subcommand => subcommand + .setName('set-reduce-vol-when-voice-target') + .setDescription('set the target volume when people speak') + .addIntegerOption(option => option + .setName('volume') + .setDescription('volume percentage (0 is muted, 100 is max & default)') + .setMinValue(0) + .setMaxValue(100) + .setRequired(true))) .addSubcommand(subcommand => subcommand .setName('set-auto-announce-next-song') .setDescription('set whether to announce the next song in the queue automatically') @@ -197,6 +213,40 @@ export default class implements Command { break; } + case 'set-reduce-vol-when-voice': { + const value = interaction.options.getBoolean('value')!; + + await prisma.setting.update({ + where: { + guildId: interaction.guild!.id, + }, + data: { + turnDownVolumeWhenPeopleSpeak: value, + }, + }); + + await interaction.reply('👍 turn down volume setting updated'); + + break; + } + + case 'set-reduce-vol-when-voice-target': { + const value = interaction.options.getInteger('volume')!; + + await prisma.setting.update({ + where: { + guildId: interaction.guild!.id, + }, + data: { + turnDownVolumeWhenPeopleSpeakTarget: value, + }, + }); + + await interaction.reply('👍 turn down volume target setting updated'); + + break; + } + case 'get': { const embed = new EmbedBuilder().setTitle('Config'); @@ -212,6 +262,7 @@ export default class implements Command { 'Add to queue reponses show for requester only': config.autoAnnounceNextSong ? 'yes' : 'no', 'Default Volume': config.defaultVolume, 'Default queue page size': config.defaultQueuePageSize, + 'Reduce volume when people speak': config.turnDownVolumeWhenPeopleSpeak ? 'yes' : 'no', }; let description = ''; -- cgit v1.2.3