userinfo: fix no args interaction

This commit is contained in:
Cynthia Foxwell 2024-08-14 00:13:29 -06:00
parent 7782efa706
commit ef6a2e0956
3 changed files with 3 additions and 3 deletions

View file

@ -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) {

View file

@ -10,7 +10,7 @@ banner.category = "utility";
banner.helpText = "Get banner of a user";
banner.usage = "<user>";
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) {

View file

@ -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];