mirror of
https://github.com/HirziDevs/PteroStats
synced 2026-01-09 15:44:01 +00:00
19 lines
710 B
JavaScript
19 lines
710 B
JavaScript
const { Client, Collection } = require('discord.js')
|
|
const fs = require('fs')
|
|
const client = new Client()
|
|
const yaml = require('js-yaml')
|
|
const config = yaml.load(fs.readFileSync('./config.yml', 'utf8'))
|
|
client.config = config
|
|
|
|
fs.readdir('./events/', (err, files) => {
|
|
if (err) return console.error(err)
|
|
files.forEach(file => {
|
|
const event = require(`./events/${file}`)
|
|
const eventName = file.split('.')[0]
|
|
client.on(eventName, event.bind(null, client))
|
|
})
|
|
})
|
|
|
|
if (config.token === 'BOT TOKEN') console.log(chalk.blue('[PteroStats Checker] ') + chalk.red('Invalid Token, Check ') + chalk.green('config.yml') + chalk.red(' file to change token'))
|
|
client.login(config.token)
|