Added name input to avatar, added alias for help, other changes
This commit is contained in:
parent
7eb9bfeef4
commit
c1f2eadf88
4 changed files with 22 additions and 2 deletions
|
@ -5,6 +5,12 @@ exports.run = async (message, args) => {
|
|||
return message.mentions[0].avatarURL;
|
||||
} else if (client.users.get(args[0]) !== undefined) {
|
||||
return client.users.get(args[0]).avatarURL;
|
||||
} else if (args.join(" ") !== "") {
|
||||
const userRegex = new RegExp(args.join("|"), "i");
|
||||
const member = message.channel.guild.members.find(element => {
|
||||
return userRegex.test(element.nick) ? userRegex.test(element.nick) : userRegex.test(element.username);
|
||||
});
|
||||
return member ? member.avatarURL : message.author.avatarURL;
|
||||
} else {
|
||||
return message.author.avatarURL;
|
||||
}
|
||||
|
|
|
@ -105,6 +105,7 @@ exports.run = async (message, args) => {
|
|||
}
|
||||
};
|
||||
|
||||
exports.aliases = ["commands"];
|
||||
exports.category = 1;
|
||||
exports.help = "Gets a list of commands";
|
||||
exports.params = "{command}";
|
Loading…
Add table
Add a link
Reference in a new issue