@@ -169,14 +169,11 @@ class RoleManager extends CachedManager {
169169 if ( typeof icon !== 'string' ) icon = undefined ;
170170 }
171171
172- let colors ;
173- if ( options . colors ) {
174- colors = {
175- primary_color : resolveColor ( options . colors . primaryColor ) ,
176- secondary_color : options . colors . secondaryColor && resolveColor ( options . colors . secondaryColor ) ,
177- tertiary_color : options . colors . tertiaryColor && resolveColor ( options . colors . tertiaryColor ) ,
178- } ;
179- }
172+ const colors = options . colors && {
173+ primary_color : resolveColor ( options . colors . primaryColor ) ,
174+ secondary_color : options . colors . secondaryColor && resolveColor ( options . colors . secondaryColor ) ,
175+ tertiary_color : options . colors . tertiaryColor && resolveColor ( options . colors . tertiaryColor ) ,
176+ } ;
180177
181178 const data = await this . client . rest . post ( Routes . guildRoles ( this . guild . id ) , {
182179 body : {
@@ -233,14 +230,11 @@ class RoleManager extends CachedManager {
233230 if ( typeof icon !== 'string' ) icon = undefined ;
234231 }
235232
236- let colors ;
237- if ( options . colors ) {
238- colors = {
239- primary_color : resolveColor ( options . colors . primaryColor ) ,
240- secondary_color : options . colors . secondaryColor && resolveColor ( options . colors . secondaryColor ) ,
241- tertiary_color : options . colors . tertiaryColor && resolveColor ( options . colors . tertiaryColor ) ,
242- } ;
243- }
233+ const colors = options . colors && {
234+ primary_color : resolveColor ( options . colors . primaryColor ) ,
235+ secondary_color : options . colors . secondaryColor && resolveColor ( options . colors . secondaryColor ) ,
236+ tertiary_color : options . colors . tertiaryColor && resolveColor ( options . colors . tertiaryColor ) ,
237+ } ;
244238
245239 const body = {
246240 name : options . name ,
0 commit comments