diff --git a/src/modules/utility/avatar.js b/src/modules/utility/avatar.js index 58e8036..4eda16e 100644 --- a/src/modules/utility/avatar.js +++ b/src/modules/utility/avatar.js @@ -13,7 +13,7 @@ avatar.addAlias("av"); avatar.addAlias("avi"); avatar.addAlias("pfp"); avatar.callback = async function (msg, line, [user], {server, guild}) { - let member = msg.member ?? msg.author; + let member = msg.member ?? msg.author ?? msg.user; const guildObj = msg.channel.guild || hf.bot.guilds.get(msg.guildID); if (server || guild) { diff --git a/src/modules/utility/banner.js b/src/modules/utility/banner.js index ecfc68e..2def1c8 100644 --- a/src/modules/utility/banner.js +++ b/src/modules/utility/banner.js @@ -10,7 +10,7 @@ banner.category = "utility"; banner.helpText = "Get banner of a user"; banner.usage = ""; banner.callback = async function (msg, line, [user], {server, guild}) { - let id = msg.author.id; + let id = msg.author?.id ?? msg.user?.id; if (server || guild) { if (!msg.guildID) { diff --git a/src/modules/utility/userinfo.js b/src/modules/utility/userinfo.js index 6fbba8f..fa93f8a 100644 --- a/src/modules/utility/userinfo.js +++ b/src/modules/utility/userinfo.js @@ -33,7 +33,7 @@ userinfo.addAlias("whois"); userinfo.callback = async function (msg, line) { let id; if (!line || line == "") { - id = msg.author.id; + id = msg.author?.id ?? msg.user?.id; } else { if (!SNOWFLAKE_REGEX.test(line)) return "Not a snowflake."; id = line.match(SNOWFLAKE_REGEX)[1];