From 9b6936e94492b0f344200122e9fd7495c307fde4 Mon Sep 17 00:00:00 2001 From: pokesudenk Date: Sat, 24 Feb 2018 20:20:09 -0500 Subject: trying this --- commands/Utility/userinfo.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'commands') diff --git a/commands/Utility/userinfo.js b/commands/Utility/userinfo.js index fb3c996..80bca74 100644 --- a/commands/Utility/userinfo.js +++ b/commands/Utility/userinfo.js @@ -1,14 +1,17 @@ exports.run = async (bot, msg) => { - const user = msg.mentions.members.first(); - const { RichEmbed } = require('discord.js'); - msg.channel.send( - new RichEmbed() - .setColor(0x00ae86) - .setTitle(`User Information`) - .addField('User ID', user.id) - .addField('Account Creation Date', user.user.createdAt) - .addField('Join Guild Date', user.joinedAt) - .addField('Names', 'Display Name: ' + user.displayName + `\nUsername: ${user.user.tag}`) + const user = msg.mentions.members.first(); + if (!user) { + user = msg.author; + }; + const { RichEmbed } = require('discord.js'); + msg.channel.send( + new RichEmbed() + .setColor(0x00ae86) + .setTitle(`User Information`) + .addField('User ID', user.id) + .addField('Account Creation Date', user.user.createdAt) + .addField('Join Guild Date', user.joinedAt) + .addField('Names', 'Display Name: ' + user.displayName + `\nUsername: ${user.user.tag}`) ); }; -- cgit v1.2.3