-
-
Save AllGistsEqual/f1a7ec8ed876a4e4cbd4a9250991c2f6 to your computer and use it in GitHub Desktop.
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
if (message.content.startsWith(`${prefix}whois`)) { | |
// if the message contains any mentions, pick the first as the target | |
if (message.mentions.users.size) { | |
const taggedUser = message.mentions.users.first() | |
message.channel.send( | |
`User Info: ${ | |
taggedUser.username | |
} (account created: ${taggedUser.createdAt.toUTCString()})`, | |
) | |
} else { | |
// default to sender if no user is mentioned | |
const { author } = message | |
message.reply( | |
`User Self Info: ${ | |
author.username | |
} (account created: ${author.createdAt.toUTCString()})`, | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment