Skip to content

Commit

Permalink
feat(status): update cron logger
Browse files Browse the repository at this point in the history
  • Loading branch information
fieztazica committed May 12, 2024
1 parent 9fe53e6 commit 935d514
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
import { Queue } from 'distube';
import { RandomLoadingMessage } from './constants';
import { schedule as cronSchedule } from 'node-cron';
import { Cron, predefined } from '@sapphire/time-utilities';
import { Cron, } from '@sapphire/time-utilities';

/**
* Picks a random item from an array
Expand Down Expand Up @@ -121,12 +121,12 @@ export function setupStatusChanger() {

client.user?.setActivity(getRandomActivity());

const cronTime = new Cron(predefined['@hourly']);
const cronTime = new Cron('* * * * *');

container.logger.info('[CRON/STATUS] StatusChanger installed at 0 minutes past the hour, every 2 hours UTC');
container.logger.info(`[CRON/STATUS] StatusChanger installed ${cronTime.normalized}, next run '${cronTime.next()}'`);
cronSchedule(cronTime.cron, () => {
const status = getRandomActivity();
container.logger.info(`[CRON] Status changed to ${status.name}`);
container.logger.info(`[CRON] Status changed to '${status.name}', next run '${cronTime.next()}'`);
client.user?.setActivity(status);
});
}
Expand Down

0 comments on commit 935d514

Please sign in to comment.