foxwells.vinboard: fix creating messages
This commit is contained in:
parent
cb00a01da3
commit
4011ef0387
1 changed files with 12 additions and 4 deletions
|
@ -283,16 +283,24 @@ async function processReaction(msg, user, reaction) {
|
||||||
await deleteBoardEntry(msg.id);
|
await deleteBoardEntry(msg.id);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.verbose(
|
|
||||||
"vinboard",
|
|
||||||
`Updating count for "${msg.id}" (${dbEntry.count ?? 0} -> ${trueCount})`
|
|
||||||
);
|
|
||||||
if (dbEntry.board_id) {
|
if (dbEntry.board_id) {
|
||||||
|
logger.verbose(
|
||||||
|
"vinboard",
|
||||||
|
`Updating count for "${msg.id}" (${
|
||||||
|
dbEntry.count ?? 0
|
||||||
|
} -> ${trueCount})`
|
||||||
|
);
|
||||||
await webhook.editMessage(
|
await webhook.editMessage(
|
||||||
dbEntry.board_id,
|
dbEntry.board_id,
|
||||||
await createBoardMessage(msg, trueCount)
|
await createBoardMessage(msg, trueCount)
|
||||||
);
|
);
|
||||||
await setBoardEntry(msg.id, trueCount, dbEntry.board_id);
|
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 {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue