bot/src/index.ts

25 lines
612 B
TypeScript
Raw Normal View History

2020-01-13 04:10:56 +00:00
import { token } from './config/bot';
2020-01-13 22:38:12 +00:00
import { EventLoader } from './events/eventLoader';
import { PluginLoader } from './plugins/pluginLoader';
import { PluginClient } from './PluginClient';
2020-01-13 04:10:56 +00:00
2020-01-13 22:38:12 +00:00
const lifeguard = new PluginClient();
2020-01-13 04:10:56 +00:00
2020-01-13 22:38:12 +00:00
EventLoader(lifeguard);
PluginLoader().then(plugins => {
lifeguard.plugins = plugins;
});
lifeguard.db
.connect()
.then(() => console.log('Connected to MongoDB'))
.catch(err => console.error(err));
2020-01-13 22:38:12 +00:00
lifeguard.login(token).then(() => {
if (lifeguard.user) {
2020-01-13 04:10:56 +00:00
console.log(
`Logged in to ${lifeguard.user.username}#${lifeguard.user.discriminator}`
2020-01-13 22:38:12 +00:00
);
}
});