Fix uinfo command, discord.js v13 seems to have removed user.presence

This commit is contained in:
Nathaniel Mason 2022-04-21 20:23:58 +01:00
parent 8c9c083d26
commit 0bc4277389
2 changed files with 35 additions and 32 deletions

View file

@ -4,52 +4,54 @@ module.exports = {
description: "Gets info about an user, such as ID, Discord Join date and more",
syntax: "<User>",
async execute(client, message, args, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author
async execute(_0, message, _1, config) {
const user = message.mentions.users.first() || message.member;
await message.channel.send({embeds: [{
"title": `Everything you've ever wanted to know about ${user.username}!`,
"title": `Everything you've ever wanted to know about ${user.user}!`,
"color": 9442302,
"footer": {
"icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt
},
"thumbnail": {
"url": user.displayAvatarURL()
"url": user.user.displayAvatarURL()
},
"fields": [
{
"name": "Username",
"value": user.username,
"value": user.user.username,
"inline": true
},
{
"name": "Discriminator",
"value": user.discriminator,
"value": user.user.discriminator,
"inline": true
},
{
"name": "Full Username",
"value": user.tag,
"value": user.user.tag,
"inline": true
},
{
"name": "User Profile Picture",
"value": user.displayAvatarURL()
"value": user.user.displayAvatarURL()
},
{
"name": "User Status",
value: user.presence.status
"value": user.presence?.status ?? "Error getting status, does the bot have the GUILD_PRESENCES intent?"
//IMPORTANT NOTE:
//There seems to be an issue where offline and invisible users return a null presense
//I'll try to patch this soon if I can figure out why
},
{
"name": "User ID",
"value": `\`${user.id}\``
"value": `\`${user.user.id}\``
},
{
"name": "User Joined Discord",
"value": user.createdAt,
inline: true
"value": user.user.createdAt.toString(),
"inline": true
},
]
}]});

View file

@ -56,6 +56,7 @@
],
"intents": [
"GUILDS",
"GUILD_MESSAGES"
"GUILD_MESSAGES",
"GUILD_PRESENCES"
]
}