Skip to content

Commit

Permalink
fix: filter out undefined embed message
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Feb 8, 2024
1 parent 2c96537 commit 18134c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils/checkRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ client.on("ready", async () => {
)
.map((m) => m.embeds)
.flat();
const latestChainIdsMessages = chains.map((chain) =>
lastMessages.find((m) => m?.title == `⛓️ Chain: ${chain}`)
);
const latestChainIdsMessages = chains
.map((chain) => lastMessages.find((m) => m?.title == `⛓️ Chain: ${chain}`))
.filter((m) => m);
for (const embed of embeds) {
if (
latestChainIdsMessages.find(
Expand Down

0 comments on commit 18134c6

Please sign in to comment.