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;

View File

@ -13,6 +13,10 @@ class CaptionCommand extends ImageCommand {
static description = "Adds a caption to an image";
static aliases = ["gifc", "gcaption", "ifcaption", "ifunnycaption"];
static arguments = ["[text]"];
static flags = [{
name: "noEgg",
description: "Disable... something. Not saying what it is though."
}];
static requiresText = true;
static noText = "You need to provide some text to add a caption!";

View File

@ -39,7 +39,9 @@ class TagsCommand extends Command {
case "owner":
if (this.args[1] === undefined) return "You need to provide the name of the tag you want to check the owner of!";
if (!tags[this.args[1].toLowerCase()]) return "This tag doesn't exist!";
return `This tag is owned by **${this.client.users.get(tags[this.args[1].toLowerCase()].author).username}#${this.client.users.get(tags[this.args[1].toLowerCase()].author).discriminator}** (\`${tags[this.args[1].toLowerCase()].author}\`).`;
var user = await this.ipc.fetchUser(tags[this.args[1].toLowerCase()].author);
if (!user) return `I couldn't find exactly who owns this tag, but I was able to get their ID: \`${tags[this.args[1].toLowerCase()].author}\``;
return `This tag is owned by **${user.username}#${user.discriminator}** (\`${tags[this.args[1].toLowerCase()].author}\`).`;
case "list":
if (!this.message.channel.permissionsOf(this.client.user.id).has("addReactions")) return "I don't have the `Add Reactions` permission!";
if (!this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";