File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ export default {
2+ cron : '*/15 * * * * *' ,
3+ async execute ( client ) {
4+ let activityList = [
5+ `with ${ client . guilds . cache . size } servers` ,
6+ `with ${ client . users . cache . size } users` ,
7+ `with ${ client . channels . cache . size } channels` ,
8+ `with ${ client . emojis . cache . size } emojis` ,
9+ ] ;
10+
11+ let activity = activityList [ Math . floor ( Math . random ( ) * activityList . length ) ] ;
12+ client . user . setActivity ( activity , {
13+ name : activity ,
14+ type : 1
15+ } ) ;
16+ }
17+ } ;
Original file line number Diff line number Diff line change 11import fs from 'fs' ;
22import cron from 'node-cron' ;
3+ import chalk from 'chalk' ;
34
45export async function loadCronJobs ( folderPath , client ) {
56 let files = fs . readdirSync ( folderPath ) ;
@@ -8,5 +9,6 @@ export async function loadCronJobs(folderPath, client) {
89 folderPath = folderPath . replace ( 'src/' , '' ) ;
910 let cronjob = await import ( `../${ folderPath } /${ files [ i ] } ` ) ;
1011 cron . schedule ( cronjob . default . cron , ( ) => cronjob . default . execute ( client ) ) ;
12+ console . log ( chalk . greenBright ( `[CRONJOB] Loaded ${ ( chalk . yellow ( files [ i ] ) ) } ` ) ) ;
1113 }
1214}
You can’t perform that action at this time.
0 commit comments