Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // clear.js
- module.exports = {
- run: async (message, args) => {
- if (!message.member.hasPermission('MANAGE_MESSAGES')) return message.channel.send('Vous n\'avez pas la permission d\'utiliser cette commande.')
- const count = args[0]
- if (!/\d+/.test(count)) return message.channel.send('Veuillez indiquer un nombre de messages à supprimer.')
- if (count < 1 || count > 99) return message.channel.send('Le nombre de message doit être compris entre 1 et 99.')
- const { size } = await message.channel.bulkDelete(Number(count) + 1, true)
- message.channel.send(`${size - 1} messages ont été supprimés !`).then(sent => sent.delete({timeout: 5e3}))
- },
- name: 'clear',
- guildOnly: true
- }
- // help.js
- const Discord = require('discord.js'),
- config = require('../config.json')
- module.exports = {
- run: (message, args, client) => {
- if (args[0]) {
- const command = client.commands.get(args[0].toLowerCase())
- if (!command || !command.help) return message.channel.send('Cette commande n\'existe pas.')
- message.channel.send(new Discord.MessageEmbed()
- .setDescription(`**Commande : ${command.name}**\n\n${command.help.description}\n\nSyntaxe : \`${config.prefix}${command.name}${command.help.syntax ? ` ${command.help.syntax}` : ''}\``))
- }
- else {
- message.channel.send(new Discord.MessageEmbed()
- .setTitle('Liste des commandes')
- .setDescription(`${client.commands.filter(command => command.help).map(command => `\`${config.prefix}${command.name}\``).join(' ')}\n\nPour plus d'informations sur une commande, tapez \`${config.prefix}help [nom de la commande]\``))
- }
- },
- name: 'help',
- help: {
- description: 'Cette commande permet d\'avoir de l\'aide.',
- syntax: '[nom de la commande]'
- }
- }
Add Comment
Please, Sign In to add comment