1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-14 16:00:17 +00:00
musix-oss/commands/settings.js

40 lines
2.1 KiB
JavaScript
Raw Normal View History

2024-02-09 09:53:30 +00:00
const { EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = {
name: 'settings',
usage: '[setting]',
description: 'Change the settings',
alias: 'settings',
2019-09-15 06:18:33 +00:00
cooldown: 10,
2024-02-09 09:53:30 +00:00
async execute(message, args, client, prefix) {
const embed = new EmbedBuilder()
.setTitle('Guild settings for Musix')
2024-02-09 09:53:30 +00:00
.addFields(
{ name: 'prefix', value: 'Change the guild specific prefix. (string)', inline: true},
{ name: 'volume', value: 'Change the default volume that the bot will start playing at. (number)', inline: true },
{ name: 'permissions', value: 'Change whether to require permissions to use eg `skip, stop, pause, loop, etc...`', inline: true },
{ name: 'setdj', value: 'Set a DJ role. This will allow chosen users to freely use all Musix commands. This will automatically set the `permissions` settings to true in order for the `DJ` role to have effect!', inline: true },
{ name: 'announcesongs', value: 'Whether to announce songs that start playing or not.' },
{ name: 'songselection', value: 'Will i ask to select a song from the top 10 queries or start playing the first result instantly.' }
)
2024-03-06 00:32:44 +00:00
.setFooter({ text: `how to use: ${prefix}settings <name> <value>` })
.setAuthor({ name: client.user.username, iconURL: client.user.avatarURL() })
.setColor(client.config.embedColor)
const permissions = message.channel.permissionsFor(message.author);
2024-02-09 09:53:30 +00:00
if (!permissions.has(PermissionFlagsBits.ManageGuild)) return message.channel.send(':x: You need the `MANAGE_SERVER` permission to change the settings!');
if (args[1]) {
const optionName = args[1].toLowerCase();
const option = client.settingCmd.get(optionName) || client.settingCmd.find(cmd => cmd.aliases && cmd.aliases.includes(optionName));
2024-02-09 09:53:30 +00:00
if (!option) return message.channel.send({ embeds: [embed] });
try {
2024-02-09 09:53:30 +00:00
option.execute(message, args, client, prefix);
} catch (error) {
2024-02-09 09:53:30 +00:00
message.reply(`:x: there was an error trying to execute that option!`);
console.log(error);
2019-10-24 17:21:55 +00:00
}
2019-09-15 06:18:33 +00:00
} else {
2024-02-09 09:53:30 +00:00
return message.channel.send({ embeds: [embed] });
}
},
2019-10-10 13:43:04 +00:00
};