mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-06-27 01:02:41 +02:00
Added config to make add to queue responses for requester only (#1021)
Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
This commit is contained in:
parent
cf775c428c
commit
8e08919206
4 changed files with 46 additions and 2 deletions
|
@ -0,0 +1,18 @@
|
|||
-- RedefineTables
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Setting" (
|
||||
"guildId" TEXT NOT NULL PRIMARY KEY,
|
||||
"playlistLimit" INTEGER NOT NULL DEFAULT 50,
|
||||
"secondsToWaitAfterQueueEmpties" INTEGER NOT NULL DEFAULT 30,
|
||||
"leaveIfNoListeners" BOOLEAN NOT NULL DEFAULT true,
|
||||
"queueAddResponseEphemeral" BOOLEAN NOT NULL DEFAULT false,
|
||||
"autoAnnounceNextSong" BOOLEAN NOT NULL DEFAULT false,
|
||||
"defaultVolume" INTEGER NOT NULL DEFAULT 100,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
INSERT INTO "new_Setting" ("autoAnnounceNextSong", "createdAt", "defaultVolume", "guildId", "leaveIfNoListeners", "playlistLimit", "secondsToWaitAfterQueueEmpties", "updatedAt") SELECT "autoAnnounceNextSong", "createdAt", "defaultVolume", "guildId", "leaveIfNoListeners", "playlistLimit", "secondsToWaitAfterQueueEmpties", "updatedAt" FROM "Setting";
|
||||
DROP TABLE "Setting";
|
||||
ALTER TABLE "new_Setting" RENAME TO "Setting";
|
||||
PRAGMA foreign_key_check;
|
||||
PRAGMA foreign_keys=ON;
|
|
@ -28,6 +28,7 @@ model Setting {
|
|||
playlistLimit Int @default(50)
|
||||
secondsToWaitAfterQueueEmpties Int @default(30)
|
||||
leaveIfNoListeners Boolean @default(true)
|
||||
queueAddResponseEphemeral Boolean @default(false)
|
||||
autoAnnounceNextSong Boolean @default(false)
|
||||
defaultVolume Int @default(100)
|
||||
createdAt DateTime @default(now())
|
||||
|
|
|
@ -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-queue-add-response-hidden')
|
||||
.setDescription('set whether bot responses to queue additions are only displayed to the requester')
|
||||
.addBooleanOption(option => option
|
||||
.setName('value')
|
||||
.setDescription('whether bot responses to queue additions are only displayed to the requester')
|
||||
.setRequired(true)))
|
||||
.addSubcommand(subcommand => subcommand
|
||||
.setName('set-auto-announce-next-song')
|
||||
.setDescription('set whether to announce the next song in the queue automatically')
|
||||
|
@ -113,6 +120,23 @@ export default class implements Command {
|
|||
break;
|
||||
}
|
||||
|
||||
case 'set-queue-add-response-eph': {
|
||||
const value = interaction.options.getBoolean('value')!;
|
||||
|
||||
await prisma.setting.update({
|
||||
where: {
|
||||
guildId: interaction.guild!.id,
|
||||
},
|
||||
data: {
|
||||
queueAddResponseEphemeral: value,
|
||||
},
|
||||
});
|
||||
|
||||
await interaction.reply('👍 queue add notification setting updated');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'set-auto-announce-next-song': {
|
||||
const value = interaction.options.getBoolean('value')!;
|
||||
|
||||
|
@ -159,6 +183,7 @@ export default class implements Command {
|
|||
: `${config.secondsToWaitAfterQueueEmpties}s`,
|
||||
'Leave if there are no listeners': config.leaveIfNoListeners ? 'yes' : 'no',
|
||||
'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,
|
||||
};
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ export default class AddQueryToQueue {
|
|||
|
||||
const settings = await getGuildSettings(guildId);
|
||||
|
||||
const {playlistLimit} = settings;
|
||||
const {playlistLimit, queueAddResponseEphemeral} = settings;
|
||||
|
||||
await interaction.deferReply();
|
||||
await interaction.deferReply({ephemeral: queueAddResponseEphemeral});
|
||||
|
||||
let newSongs: SongMetadata[] = [];
|
||||
let extraMsg = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue