Skip to content
Snippets Groups Projects
Commit 45848c36 authored by Reviath's avatar Reviath
Browse files

Update icon command, added clear command.

parent 2d13fd04
Branches
Tags
No related merge requests found
const errors = require('../errors.json');
exports.run = async (client, message, args, connection) => {
if (!message.member.hasPermission('MANAGE_MESSAGES')) {
message.channel.send(errors.insufficient_permission_for_user).catch(e => {
return;
});
};
const amount = parseInt(args[0])
if (!amount) {
message.channel.send(errors.insufficient_args).catch(e => {
return;
});
return;
};
if (amount > 100) {
message.channel.send("Cannot delete more than 100 messages.").catch(e => {
return;
});
};
message.channel.bulkDelete(amount).catch(e => {
message.channel.send(errors.insufficient_permission_for_bot).catch(e => {
return;
});
return
});
message.channel.send(`Deleted ${args[0]} messages.`).catch(e => {
return;
});
};
module.exports.help = {
name: 'clear',
aliases: ['purge']
};
\ No newline at end of file
const Discord = require('discord.js');
const errors = require('../errors.json');
exports.run = async (client, message, args, connection) => {
const embed = new Discord.MessageEmbed()
.setImage(message.guild.iconURL())
.setColor(0x0093f0);
message.channel.send(embed).catch(e => {
message.channel.send(`Cannot send an embed.`).catch(e => {
message.channel.send(errors.cannot_send_embed).catch(e => {
return;
});
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment