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", description: "Gets info about an user, such as ID, Discord Join date and more",
syntax: "<User>", syntax: "<User>",
async execute(client, message, args, config) { async execute(_0, message, _1, config) {
const user = message.mentions.users.first() || client.users.cache.get(args[0]) || message.author const user = message.mentions.users.first() || message.member;
await message.channel.send({embeds: [{ 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, "color": 9442302,
"footer": { "footer": {
"icon_url": message.author.displayAvatarURL(), "icon_url": message.author.displayAvatarURL(),
"text": config.footerTxt "text": config.footerTxt
}, },
"thumbnail": { "thumbnail": {
"url": user.displayAvatarURL() "url": user.user.displayAvatarURL()
}, },
"fields": [ "fields": [
{ {
"name": "Username", "name": "Username",
"value": user.username, "value": user.user.username,
"inline": true "inline": true
}, },
{ {
"name": "Discriminator", "name": "Discriminator",
"value": user.discriminator, "value": user.user.discriminator,
"inline": true "inline": true
}, },
{ {
"name": "Full Username", "name": "Full Username",
"value": user.tag, "value": user.user.tag,
"inline": true "inline": true
}, },
{ {
"name": "User Profile Picture", "name": "User Profile Picture",
"value": user.displayAvatarURL() "value": user.user.displayAvatarURL()
}, },
{ {
"name": "User Status", "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", "name": "User ID",
"value": `\`${user.id}\`` "value": `\`${user.user.id}\``
}, },
{ {
"name": "User Joined Discord", "name": "User Joined Discord",
"value": user.createdAt, "value": user.user.createdAt.toString(),
inline: true "inline": true
}, },
] ]
}]}); }]});

View File

@ -1,21 +1,21 @@
{ {
"prefix": "n!", "prefix": "n!",
"token": "IM SO EXCITED ABOUT BURGER", "token": "IM SO EXCITED ABOUT BURGER",
"ownerID": "MY FAVORITE COLOR IS TWELVE", "ownerID": "MY FAVORITE COLOR IS TWELVE",
"release": "anitrox_dev", "release": "anitrox_dev",
"build": "Stable", "build": "Stable",
"footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022", "footerTxt": "Anitrox, made with <3 by IDeletedSystem64 | 2018-2022",
"statuses": [ "statuses": [
"with np!help", "with np!help",
"with Sophie!", "with Sophie!",
"Trans Rights!", "Trans Rights!",
"in your computer", "in your computer",
"with my internet router", "with my internet router",
"ssh: system64@borkeonv2", "ssh: system64@borkeonv2",
"YouTube", "YouTube",
"with source code", "with source code",
"Visual Studio Code", "Visual Studio Code",
"Minecraft", "Minecraft",
"with the network connections.", "with the network connections.",
"VLC Media Player", "VLC Media Player",
@ -56,6 +56,7 @@
], ],
"intents": [ "intents": [
"GUILDS", "GUILDS",
"GUILD_MESSAGES" "GUILD_MESSAGES",
"GUILD_PRESENCES"
] ]
} }