From 1aa5c8c4829e579e05aace982aed0721c4a5b20d Mon Sep 17 00:00:00 2001 From: Emily J Date: Wed, 3 Mar 2021 16:59:50 +1100 Subject: [PATCH] default to bots highest role for colour --- bot/util/functions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot/util/functions.js b/bot/util/functions.js index 586f445..2ede1e8 100644 --- a/bot/util/functions.js +++ b/bot/util/functions.js @@ -27,7 +27,7 @@ class Functions { return false; } } - + intBetween (min, max) { return Math.round((Math.random() * (max - min) + min)); } @@ -66,6 +66,7 @@ class Functions { } displayHexColour (guild, userID) { + if (!userID) userID === this.client.user.id; const roles = this.roleObjects(guild, guild.members.get(userID).roles); for (const object of roles) { if (object.color !== 0) return '#' + object.color.toString(16);