utils.getTopColor: fallback if no guild
This commit is contained in:
parent
ab5f25fdcc
commit
14b526ca55
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue