Created
August 5, 2017 04:38
-
-
Save Jackzmc/20d7b5c8bc18a4eed2bcf532280fee84 to your computer and use it in GitHub Desktop.
the hacks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
cmd:"user-info", | |
aliases:['userinfo'], | |
description:"Gets information from a user ID/name", | |
parameters:[], | |
execute: (client,msg,arg) => { | |
var userList = client.users.array(); | |
var lookup = (user) => { | |
var member_info, | |
user_info; | |
if(msg.guild.members.has(user.id)) { | |
var minfo = msg.guild.members.get(user.id); | |
member_info = `**Nickname:** ${((minfo.nickname) ? minfo.nickname : '*none*')}\n` | |
+ `**Joined:** ${moment(minfo.joinedAt).format('MMMM Do YYYY, h:mm:ss a')}\n` | |
+ `**Roles: ** ${minfo.roles.array().join(', ')}`; | |
}else{ | |
member_info = `${user.username} is not in this guild`; | |
} | |
user_info = `**Created:** ${moment(user.createdAt).format('MMMM Do YYYY, h:mm:ss a')}\n` | |
+ `**Presence:** ${vars.capFirst(user.presence.status)}` + ((user.presence.game) ? `, Playing ${user.presence.game.name}` : ''); | |
return msg.channel.send({embed: { | |
title:`${user.username}'s stats`, | |
description:`ID: ${user.id}\n\n`, | |
color:10037274, | |
fields:[ | |
{ | |
name:"❯ Member Info", | |
value:`${member_info}`, | |
}, | |
{ | |
name:"❯ User Info", | |
value:`${user_info}`, | |
} | |
] | |
}}); | |
//check if member of guild, if so stats | |
} | |
for(var i=0;i<userList.length;i++) { | |
if(userList[i].id === arg[1]) { | |
return lookup(userList[i]); | |
} | |
if(msg.mentions.users.has(userList[i].id)) { | |
return lookup(userList[i]); | |
} | |
} | |
return msg.reply("No results"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment