diff --git a/app.js b/app.js index 16f1e57..27757ab 100644 --- a/app.js +++ b/app.js @@ -91,7 +91,7 @@ const Admiral = new Fleet({ users: true, repliedUser: true }, - guildSubscriptions: false, + restMode: true, messageLimit: 50, intents: [ "guilds", @@ -158,4 +158,4 @@ if (isMaster) { }); }); } -} \ No newline at end of file +} diff --git a/commands/general/avatar.js b/commands/general/avatar.js index ddaba9e..01d6d00 100644 --- a/commands/general/avatar.js +++ b/commands/general/avatar.js @@ -7,6 +7,13 @@ class AvatarCommand extends Command { } else if (await this.ipc.fetchUser(this.args[0])) { const user = await this.ipc.fetchUser(this.args[0]); return user.avatar ? this.client._formatImage(`/avatars/${user.id}/${user.avatar}`, null, 1024) : `https://cdn.discordapp.com/embed/avatars/${user.discriminator % 5}.png`; // hacky "solution" + } else if (this.args[0].match(/^?$/) && this.args[0] >= 21154535154122752) { + try { + const user = await this.client.getRESTUser(this.args[0]); + return user.avatar ? this.client._formatImage(`/avatars/${user.id}/${user.avatar}`, null, 1024) : `https://cdn.discordapp.com/embed/avatars/${user.discriminator % 5}.png`; // repeat of hacky "solution" from above + } catch { + return this.message.author.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 => { @@ -23,4 +30,4 @@ class AvatarCommand extends Command { static arguments = ["{mention/id}"]; } -export default AvatarCommand; \ No newline at end of file +export default AvatarCommand; diff --git a/commands/general/userinfo.js b/commands/general/userinfo.js index 36fb0a3..75ac4a2 100644 --- a/commands/general/userinfo.js +++ b/commands/general/userinfo.js @@ -6,6 +6,12 @@ class UserInfoCommand extends Command { let user; if (getUser) { user = getUser; + } else if (this.args[0].match(/^?$/) && this.args[0] >= 21154535154122752) { + try { + user = await this.client.getRESTUser(this.args[0]); + } catch { + user = this.message.author; + } } else if (this.args.join(" ") !== "") { const userRegex = new RegExp(this.args.join("|"), "i"); const member = this.client.users.find(element => { @@ -54,4 +60,4 @@ class UserInfoCommand extends Command { static arguments = ["[mention/id]"]; } -export default UserInfoCommand; \ No newline at end of file +export default UserInfoCommand; diff --git a/commands/tags/tags.js b/commands/tags/tags.js index 37a7d52..ab218b9 100644 --- a/commands/tags/tags.js +++ b/commands/tags/tags.js @@ -39,8 +39,16 @@ class TagsCommand extends Command { const getResult = await database.getTag(this.message.channel.guild.id, this.args[1].toLowerCase()); if (!getResult) return "This tag doesn't exist!"; const user = await this.ipc.fetchUser(getResult.author); - if (!user) return `I couldn't find exactly who owns this tag, but I was able to get their ID: \`${getResult.author}\``; - return `This tag is owned by **${user.username}#${user.discriminator}** (\`${getResult.author}\`).`; + if (!user) { + try { + const restUser = await this.client.getRESTUser(getResult.author); + return `This tag is owned by **${restUser.username}#${restUser.discriminator}** (\`${getResult.author}\`).`; + } catch { + return `I couldn't find exactly who owns this tag, but I was able to get their ID: \`${getResult.author}\``; + } + } else { + return `This tag is owned by **${user.username}#${user.discriminator}** (\`${getResult.author}\`).`; + } } else if (this.args[0].toLowerCase() === "list") { if (!this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!"; const tagList = await database.getTags(this.message.channel.guild.id); @@ -118,4 +126,4 @@ class TagsCommand extends Command { }; } -export default TagsCommand; \ No newline at end of file +export default TagsCommand;