master
Kit Kasune 4 years ago
parent 167da961e2
commit 73ee25a5f7
  1. 14
      commands/prefix.js

@ -8,7 +8,7 @@ module.exports = {
.setDescription("Changes your server's prefix.") .setDescription("Changes your server's prefix.")
.addField("Syntax", "`prefix <newPrefix|clear>`") .addField("Syntax", "`prefix <newPrefix|clear>`")
.addField("Staff Command", "This command requires you to either be admin, or to have the designated staff role.") .addField("Staff Command", "This command requires you to either be admin, or to have the designated staff role.")
.addField("Noticed", "Prefixes are cached, and may take up to a minute to update."), .addField("Notice", "Prefixes are cached, and may take up to a minute to update."),
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
if (!message.guild) {return message.reply("This is a guild-only command!");} if (!message.guild) {return message.reply("This is a guild-only command!");}
let tguild = await GuildSettings.findOne({gid: message.guild.id}) let tguild = await GuildSettings.findOne({gid: message.guild.id})
@ -21,6 +21,16 @@ module.exports = {
if (!np.match(/^[a-zA-Z0-9,.!?<>\-_+=/;$#%^&*]$/m)) {return message.reply('Your custom prefix contains some *wonky* characters. Please use only alphanumerics and basic symbols.');} if (!np.match(/^[a-zA-Z0-9,.!?<>\-_+=/;$#%^&*]$/m)) {return message.reply('Your custom prefix contains some *wonky* characters. Please use only alphanumerics and basic symbols.');}
tguild.prefix = ['c', 'clear', 'n', 'none'].includes(np.trim().toLowerCase()) ? '' : np; tguild.prefix = ['c', 'clear', 'n', 'none'].includes(np.trim().toLowerCase()) ? '' : np;
tguild.save(); tguild.save();
let upm = message.reply("sure thing!");
await require('../util/wait')(1750);
return upm.edit(new Discord.MessageEmbed()
.setAuthor('Prefix updated!', message.author.avatarURL())
.setDescription(`New prefix: \`${np}\``)
.addField('Auditing Admin', `<@${message.member.id}>`, true)
.addField("Notice", "Prefixes are cached, and may take up to a minute to update.")
.setColor('c375f0')
.setFooter('Natsuki', client.user.avatarURL())
.setTimestamp()
);
} }
}; };
Loading…
Cancel
Save