File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,15 @@ const saveMessageToCache = ({
5959 "The embed exceeds one or more of limits on embeds."
6060 ) ;
6161 }
62+ if (
63+ data . embed ?. color !== undefined &&
64+ ( data . embed . color > 16777215 || data . embed . color < 0 )
65+ ) {
66+ throw new ExpectedFailure (
67+ InteractionOrRequestFinalStatus . EMBED_EXCEEDS_DISCORD_LIMITS ,
68+ "The embed color exceeds the maximum value of 16777215."
69+ ) ;
70+ }
6271 }
6372 return instance . redisCache . setMessageCache ( key , data ) ;
6473} ;
Original file line number Diff line number Diff line change @@ -160,6 +160,15 @@ async function editMessage({
160160 "The embed exceeds one or more of limits on embeds."
161161 ) ;
162162 }
163+ if (
164+ embed ?. color !== undefined &&
165+ ( embed . color > 16777215 || embed . color < 0 )
166+ ) {
167+ throw new ExpectedFailure (
168+ InteractionOrRequestFinalStatus . EMBED_EXCEEDS_DISCORD_LIMITS ,
169+ "The embed color exceeds the maximum value of 16777215."
170+ ) ;
171+ }
163172
164173 // Also check if title and / or description is set on the embed
165174 if ( embed . title === undefined && embed . description === undefined ) {
Original file line number Diff line number Diff line change @@ -161,6 +161,12 @@ async function sendMessage({
161161 "The embed exceeds one or more of limits on embeds."
162162 ) ;
163163 }
164+ if ( embed ?. color !== undefined && ( embed . color > 16777215 || embed . color < 0 ) ) {
165+ throw new ExpectedFailure (
166+ InteractionOrRequestFinalStatus . EMBED_EXCEEDS_DISCORD_LIMITS ,
167+ "The embed color exceeds the maximum value of 16777215."
168+ ) ;
169+ }
164170 // Also check if title and / or description is set on the embed
165171 // Also a discord restriction
166172 if ( embed . title === undefined && embed . description === undefined ) {
You can’t perform that action at this time.
0 commit comments