Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Apr 7, 2024
1 parent 0f3f0ba commit dc6b428
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/handlers/dynamicIcon.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,29 @@ export const dynamicIconHandler: Handler = (client) => {
client.on('messageCreate', async (message) => {
if (message.content != 'start numismatics icon thingy please') return;
if (!message.member?.permissions.has('Administrator')) {
message.reply('nuh uh');
await message.reply('nuh uh');
return;
}
if (timeout) {
message.reply('it already started silly');
await message.reply('it already started silly');
return;
}
message.reply('ok!!');
await message.reply('ok!!');
const updateIcon = async () => {
const currentTime = Date.now() - startTime;
const currentProgress = currentTime / totalTime;
console.log(currentProgress);
console.log(
`Current Progress at ${Date.now()} is ${currentProgress}`
);
message.guild?.setIcon(
await stream2buffer(await generateIcon(currentProgress / 2))
);
if (currentProgress == 2) {
clearInterval(timeout);
}
};
updateIcon();
timeout = setInterval(updateIcon, 1800_000);
await updateIcon();
timeout = setInterval(updateIcon, 3600_000);
});
};

Expand Down

0 comments on commit dc6b428

Please sign in to comment.