[RFC] Auto-announce when new song comes on (#914)

Co-authored-by: Andrew Mike <andrew@7thmagic.net>
Co-authored-by: Andrew Mike <logomancer@gmail.com>
This commit is contained in:
Andrew Mike 2024-03-03 16:43:56 -05:00 committed by GitHub
parent 1d5729fd6c
commit ccd8793cc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 1 deletions

View file

@ -33,6 +33,13 @@ export default class implements Command {
.setName('value')
.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 = '';