Fixed getting users
This commit is contained in:
parent
833ac924d5
commit
ef0e1bcf95
4 changed files with 10 additions and 4 deletions
|
@ -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 => {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue