aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
authorAndrew Mike <[email protected]>2024-03-03 16:43:56 -0500
committerGitHub <[email protected]>2024-03-03 15:43:56 -0600
commitccd8793cc1d8c91423cd37926b51ca283e3a8c39 (patch)
treec0b51ea752249504f822f9dac07e31d5a5a2a359 /src/commands
parent1d5729fd6c9f7dc5f2f9ca599fcdd8fdbe138c84 (diff)
downloadmuse-ccd8793cc1d8c91423cd37926b51ca283e3a8c39.tar.xz
muse-ccd8793cc1d8c91423cd37926b51ca283e3a8c39.zip
[RFC] Auto-announce when new song comes on (#914)
Co-authored-by: Andrew Mike <[email protected]> Co-authored-by: Andrew Mike <[email protected]>
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/config.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/commands/config.ts b/src/commands/config.ts
index 7f25a2e..9441dab 100644
--- a/src/commands/config.ts
+++ b/src/commands/config.ts
@@ -34,6 +34,13 @@ export default class implements Command {
.setDescription('whether to leave when everyone else leaves')
.setRequired(true)))
.addSubcommand(subcommand => subcommand
+ .setName('set-auto-announce-next-song')
+ .setDescription('set whether to announce the next song in the queue automatically')
+ .addBooleanOption(option => option
+ .setName('value')
+ .setDescription('whether to announce the next song in the queue automatically')
+ .setRequired(true)))
+ .addSubcommand(subcommand => subcommand
.setName('get')
.setDescription('show all settings'));
@@ -97,6 +104,23 @@ export default class implements Command {
break;
}
+ case 'set-auto-announce-next-song': {
+ const value = interaction.options.getBoolean('value')!;
+
+ await prisma.setting.update({
+ where: {
+ guildId: interaction.guild!.id,
+ },
+ data: {
+ autoAnnounceNextSong: value,
+ },
+ });
+
+ await interaction.reply('👍 auto announce setting updated');
+
+ break;
+ }
+
case 'get': {
const embed = new EmbedBuilder().setTitle('Config');
@@ -108,6 +132,7 @@ export default class implements Command {
? 'never leave'
: `${config.secondsToWaitAfterQueueEmpties}s`,
'Leave if there are no listeners': config.leaveIfNoListeners ? 'yes' : 'no',
+ 'Auto announce next song in queue': config.autoAnnounceNextSong ? 'yes' : 'no',
};
let description = '';