utility.guildinfo: fix guildID fallback not getting a guild in cases where it can

This commit is contained in:
Cynthia Foxwell 2024-05-18 23:13:42 -06:00
parent cfd6664ea8
commit e280d90053

View file

@ -1981,7 +1981,11 @@ guildinfo.callback = async function (msg, line) {
if (!line || line == "") { if (!line || line == "") {
if (!msg.guildID) return "Not in a guild."; if (!msg.guildID) return "Not in a guild.";
const __guild = msg.channel.guild ?? hf.bot.guilds.get(msg.guildID); const __guild = msg.channel.guild ?? hf.bot.guilds.get(msg.guildID);
if (__guild) _guild = {source: "local", data: __guild}; if (__guild) {
_guild = {source: "local", data: __guild};
} else {
_guild = await getGuild(msg.guildID);
}
} else { } else {
if (!SNOWFLAKE_REGEX.test(line)) return "Not a snowflake."; if (!SNOWFLAKE_REGEX.test(line)) return "Not a snowflake.";
const snowflake = line.match(SNOWFLAKE_REGEX)[1]; const snowflake = line.match(SNOWFLAKE_REGEX)[1];