Fixed getting users

This commit is contained in:
Essem 2021-07-17 18:48:07 -05:00
parent 833ac924d5
commit ef0e1bcf95
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 10 additions and 4 deletions

View file

@ -4,8 +4,8 @@ class AvatarCommand extends Command {
async run() {
if (this.message.mentions[0] !== undefined) {
return this.message.mentions[0].dynamicAvatarURL(null, 1024);
} else if (this.client.users.get(this.args[0]) !== undefined) {
return this.client.users.get(this.args[0]).dynamicAvatarURL(null, 1024);
} else if (await this.ipc.fetchUser(this.args[0]) !== undefined) {
return await this.ipc.fetchUser(this.args[0]).dynamicAvatarURL(null, 1024);
} else if (this.args.join(" ") !== "" && this.message.channel.guild) {
const userRegex = new RegExp(this.args.join("|"), "i");
const member = this.message.channel.guild.members.find(element => {

View file

@ -2,7 +2,7 @@ const Command = require("../../classes/command.js");
class UserInfoCommand extends Command {
async run() {
const getUser = this.message.mentions.length >= 1 ? this.message.mentions[0] : (this.args.length !== 0 ? this.client.users.get(this.args[0]) : this.message.author);
const getUser = this.message.mentions.length >= 1 ? this.message.mentions[0] : (this.args.length !== 0 ? await this.ipc.fetchUser(this.args[0]) : this.message.author);
let user;
if (getUser) {
user = getUser;