discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.39k stars 3.97k forks source link

Discord.js Mentions #2191

Closed Warido37 closed 6 years ago

Warido37 commented 6 years ago

Hi, i want to make a /kill command but if somebody mentions someone then it sorta returns the ID or something... >> - Warido killffed <@246972515442884619>

Hi, i want to make a /kill command but if somebody mentions someone then it sorta returns the ID or something... >> - Warido killffed <@246972515442884619>

`const commando = require('discord.js-commando');

class Kill extends commando.Command{ constructor(client){ super(client,{ name : 'kill', group : 'kill', memberName : 'kill', description : 'Return a percentage of true love!', }); }

async run(message, args){
    if(args.length !== 0){
        if(message.mentions.length == 0){
            message.channel.sendCode('diff','- ' + message.author.username + ' killffed ' + args.toString());
            message.delete();
        }else{
            message.channel.sendCode('diff','- ' + message.author.username + ' killffed'  + args.toString());
            message.delete();
        }
    }
}

}

module.exports = Kill;`

Bacon1661 commented 6 years ago

Please ask your questions on the Discord server