diff --git a/src/modules/foxwells.js b/src/modules/foxwells.js index 9a2c1e5..1788185 100644 --- a/src/modules/foxwells.js +++ b/src/modules/foxwells.js @@ -283,16 +283,24 @@ async function processReaction(msg, user, reaction) { await deleteBoardEntry(msg.id); } } else { - logger.verbose( - "vinboard", - `Updating count for "${msg.id}" (${dbEntry.count ?? 0} -> ${trueCount})` - ); if (dbEntry.board_id) { + logger.verbose( + "vinboard", + `Updating count for "${msg.id}" (${ + dbEntry.count ?? 0 + } -> ${trueCount})` + ); await webhook.editMessage( dbEntry.board_id, await createBoardMessage(msg, trueCount) ); await setBoardEntry(msg.id, trueCount, dbEntry.board_id); + } else { + logger.verbose("vinboard", `Creating entry for "${msg.id}"`); + const boardMessage = await webhook.execute( + await createBoardMessage(msg, trueCount) + ); + await setBoardEntry(msg.id, trueCount, boardMessage.id); } } } else {