-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.ts
33 lines (24 loc) · 1.05 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Bot } from '@Main/bot';
import { _PROJECT_INFO, SweetConsole } from "@Main/utils";
import config from '@Config';
import chalk from "chalk";
(async function main(bot: Bot): Promise<void> {
SweetConsole.setDebugMode(true);
console.clear();
console.log(chalk.blueBright(`\n\n${_PROJECT_INFO.ascii_art}\n\n`));
SweetConsole.Message(`Thanks for using ${_PROJECT_INFO.name}!`)
.Message(`Version: ${_PROJECT_INFO.version}`)
.Message(`Author: ${_PROJECT_INFO.author}`)
.Message(`If you notice any bug, please report it: https://github.com/${_PROJECT_INFO.author}/${_PROJECT_INFO.name}/issues`);
try {
SweetConsole.Info(`Bot is starting...`);
await bot.start()
} catch (error) {
SweetConsole.Error(`Bot failed to start!`)
.Debug(`${error.stack}`)
.Info(`Retrying after 10 seconds...`);
setTimeout(() => main(bot), 10e3);
}
if (bot.isStarted)
SweetConsole.Info(`Bot has started!`);
})(new Bot({ config }));