woomy/src/commands/prefix.js

31 lines
986 B
JavaScript
Raw Normal View History

2020-01-25 10:02:43 +00:00
exports.run = async (client, message, args) => {
const settings = message.settings;
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});
if (args[0]) {
const joinedValue = args.join(" ");
if (joinedValue === settings.prefix) return message.channel.send("<:error:466995152976871434> The prefix is already set to that!");
if (!client.settings.has(message.guild.id)) client.settings.set(message.guild.id, {});
client.settings.set(message.guild.id, joinedValue, "prefix");
message.channel.send(`<:success:466995111885144095> Set the prefix to \`${joinedValue}\``);
} else {
message.channel.send(`The current prefix is: \`${settings.prefix}\``)
}
}
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "Administrator",
requiredPerms: []
};
exports.help = {
name: "prefix",
category: "Configure",
description: "Sets the prefix for this server.",
usage: "prefix [prefix]"
};