utils.getTopColor: fallback if no guild

This commit is contained in:
Cynthia Foxwell 2024-05-17 16:03:57 -06:00
parent ab5f25fdcc
commit 14b526ca55

View file

@ -18,7 +18,8 @@ function formatUsername(user) {
function getTopColor(msg, id, fallback = 0x7289da) {
if (!msg.guildID) return fallback;
const guild = msg.channel.guild || hf.bot.guilds.get(msg.guildID);
const guild = msg.channel?.guild ?? hf.bot.guilds.get(msg.guildID);
if (!guild) return fallback;
const roles = guild.members
.get(id)