Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Commit

Permalink
update 'update' command to support when time runs out
Browse files Browse the repository at this point in the history
  • Loading branch information
iwa committed Aug 14, 2020
1 parent 7f47b33 commit 08bc25e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ module.exports.run = async (bot: Client, msg: Message, args: string[]) => {
await bot.user.setStatus('idle').catch(console.error);

setInterval(async () => {
min -= 1;
await bot.user.setActivity(`⚠️ update in ${min}min`, { type: 'LISTENING' }).catch(console.error);
if(min > 1) {
min -= 1;
await bot.user.setActivity(`⚠️ update in ${min}min`, { type: 'LISTENING' }).catch(console.error);
} else {
await bot.user.setActivity(`⚠️ update soon...`, { type: 'LISTENING' }).catch(console.error);
}
}, 60000);
};

Expand Down

0 comments on commit 08bc25e

Please sign in to comment.