Skip to content

Commit

Permalink
Create user-info.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubaid7 authored Feb 9, 2021
1 parent 498de64 commit 54c8671
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Episode 16/commands/Info/user-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { MessageEmbed } = require('discord.js')
const moment = require('moment') // npm i moment
moment.locale('ENG')

module.exports ={
commands: ['userinfo', 'user-info', 'ui', 'memberinfo', 'member-info', 'mi'], // You Can Keep Any Name
description: 'Shows User Info About A User or Pinged User.', // Optional

callback: (message, args) => {

const member = message.mentions.members.first() || message.member
// For Status Of User, We Will Use Emoji To Look Nice
const status = {
online: '🟢:- Online',
idle: '🟡:- Idle',
dnd: '🔴:- DND',
offline: '⚫:- Offline'
}

const embed = new MessageEmbed()
.setColor('RANDOM')
.setTitle(`User Info Of ${member.user.username}`, member.user.displayAvatarURL())
.setThumbnail(member.user.displayAvatarURL({dynamic: true, size: 512}))
.addField('<a:Right:805663924267384852> **User-Name**', `${member.user.username}#${member.user.discriminator}`) // We Use Emojis Also
.addField('<a:Right:805663924267384852> **User ID**', `${member.id}`)
.addField('<a:Right:805663924267384852> **Status**', `${status[member.presence.status]}`)
.addField('<a:Right:805663924267384852> **Account Created**', `${moment.utc(member.user.createdAt).format('LLLL')}`)
.addField('<a:Right:805663924267384852> **Joined Server**', `${moment.utc(member.joinedAt).format('LLLL')}`)
.addField('<a:Right:805663924267384852> **VC**', member.voice.channel ? member.voice.channel.name + `(${member.voice.channel.id})` : 'Not In A VC')
.addField('<a:Right:805663924267384852> **Roles**', `${member.roles.cache.map(role => role.toString())}`, true)
// Add More Fields If Want
message.channel.send(embed)
}
}

0 comments on commit 54c8671

Please sign in to comment.