Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
feat: set default player volume to 50%, allow player options to be co…
Browse files Browse the repository at this point in the history
…nfigured from config
  • Loading branch information
mariusbegby committed Jul 12, 2023
1 parent 4622f18 commit 6826fea
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions commands/play.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { SlashCommandBuilder } = require('@discordjs/builders');
const { useMainPlayer } = require('discord-player');
const { EmbedBuilder } = require('discord.js');
const { embedColors } = require('../config.json');
const { embedColors, playerOptions } = require('../config.json');

module.exports = {
data: new SlashCommandBuilder()
Expand Down Expand Up @@ -67,11 +67,15 @@ module.exports = {
{
requestedBy: interaction.user,
nodeOptions: {
leaveOnEmptyCooldown: 60000,
leaveOnEndCooldown: 60000,
leaveOnStopCooldown: 60000,
maxSize: 10000,
maxHistorySize: 100
leaveOnEmpty: playerOptions.leaveOnEmpty ?? true,
leaveOnEmptyCooldown: playerOptions.leaveOnEmptyCooldown ?? 60000,
leaveOnEnd: playerOptions.leaveOnEnd ?? true,
leaveOnEndCooldown: playerOptions.leaveOnEndCooldown ?? 60000,
leaveOnStop: playerOptions.leaveOnStop ?? true,
leaveOnStopCooldown: playerOptions.leaveOnStopCooldown ?? 60000,
maxSize: playerOptions.maxQueueSize ?? 1000,
maxHistorySize: playerOptions.maxHistorySize ?? 100,
volume: playerOptions.defaultVolume ?? 50
}
}
);
Expand Down

0 comments on commit 6826fea

Please sign in to comment.