Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created January 18, 2021 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllGistsEqual/f1a7ec8ed876a4e4cbd4a9250991c2f6 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/f1a7ec8ed876a4e4cbd4a9250991c2f6 to your computer and use it in GitHub Desktop.
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