2021-04-05 04:35:12 +00:00
import { client } from "../index" ;
2021-12-09 03:56:11 +00:00
import { User , getPrefix } from "../lib" ;
2021-04-05 04:35:12 +00:00
client . once ( "ready" , ( ) = > {
if ( client . user ) {
2021-04-05 12:21:27 +00:00
console . ready (
2021-05-08 13:32:45 +00:00
` Logged in as ${ client . user . tag } , ready to serve ${ client . users . cache . size } users in ${ client . guilds . cache . size } servers. `
2021-04-05 12:21:27 +00:00
) ;
2021-04-05 04:35:12 +00:00
client . user . setActivity ( {
type : "LISTENING" ,
2021-12-08 07:27:56 +00:00
name : ` ${ getPrefix ( ) } help `
2021-04-05 04:35:12 +00:00
} ) ;
2021-04-07 06:43:39 +00:00
// Run this setup block once to restore eco bet money in case the bot went down. (And I guess search the client for those users to let them know too.)
2021-12-09 03:56:11 +00:00
const users = User . all ( ) ;
2021-04-07 06:43:39 +00:00
2021-12-09 03:56:11 +00:00
for ( const user of users ) {
2021-04-07 06:43:39 +00:00
if ( user . ecoBetInsurance > 0 ) {
client . users . cache
2021-12-09 03:56:11 +00:00
. get ( user . id )
2021-04-07 06:43:39 +00:00
? . send (
` Because my system either crashed or restarted while you had a pending bet, the total amount of money that you bet, which was \` ${ user . ecoBetInsurance } \` , has been restored. `
) ;
user . money += user . ecoBetInsurance ;
user . ecoBetInsurance = 0 ;
}
}
2021-04-05 04:35:12 +00:00
}
} ) ;