Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Discord = require("discord.js");
- var config = require("../config.json");
- module.exports.run = async(client, message, args) =>{
- if(!message.guild.member(message.author).hasPermission("MANAGE_MESSAGES")) return message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.errorTitle,
- description: config.permissionRequired + "MANAGE_MESSAGES !",
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- if(!message.guild.member(client.user).hasPermission("MANAGE_MESSAGES")) return message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.errorTitle,
- description: config.botPermissionRequired + "MANAGE_MESSAGES !",
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- if(!args[0] || isNaN(args[0]) || args[0] === 0) return message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.errorTitle,
- description: config.numberRequired,
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- message.channel.bulkDelete(args[0]).catch(e =>{
- message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.errorTitle,
- description: "Une erreur est survenue: " + "```" + e + "```",
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- });
- if(args[0] > 1){
- message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.successTitle,
- description: `${args[0]} ont été supprimés !`,
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- }
- if(args[0] === 1){
- message.channel.send({
- embed: {
- color: config.colorEmbed,
- title: config.successTitle,
- description: `${args[0]} message à été supprimé !`,
- footer: {
- icon_url: message.author.displayAvatarURL,
- text: config.footerMessage + message.author.username
- }
- }
- });
- }
- }
- module.exports.help ={
- name: "clear"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement