Skip to content

Commit

Permalink
Reset inactive timer on redraw
Browse files Browse the repository at this point in the history
  • Loading branch information
gruppler committed Jun 30, 2024
1 parent d74c6bb commit 025f290
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commands/redraw.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const { SlashCommandBuilder } = require("discord.js");
const {
clearInactiveTimer,
drawBoard,
getGameData,
getTheme,
getTurnMessage,
isGameOngoing,
sendMessage,
sendPngToDiscord,
setInactiveTimer,
} = require("../util");

module.exports = {
Expand All @@ -24,6 +26,10 @@ module.exports = {
const gameData = getGameData(interaction);
const canvas = drawBoard(gameData, getTheme(interaction));
const message = getTurnMessage(gameData, canvas);
await sendPngToDiscord(interaction, canvas, message);

clearInactiveTimer(interaction);
setInactiveTimer(interaction, gameData, canvas);

return sendPngToDiscord(interaction, canvas, message);
},
};

0 comments on commit 025f290

Please sign in to comment.