![deepsource-autofix[bot]](/assets/img/avatar_default.png)
This commit fixes the style issues introduced in 9780e8c
according to the output
from standardjs and prettier.
Details: https://deepsource.io/gh/ZynerOrg/xyter/transform/dcd0e7f9-fa2c-4994-b383-8bbe416990d2/
65 lines
1.5 KiB
TypeScript
65 lines
1.5 KiB
TypeScript
import "tsconfig-paths/register"; // Allows using tsconfig.json paths during runtime
|
|
|
|
import { token, intents } from "@config/discord";
|
|
|
|
import { Client } from "discord.js"; // discord.js
|
|
|
|
import database from "@database";
|
|
import schedules from "@schedules";
|
|
import events from "@handlers/events";
|
|
import commands from "@handlers/commands";
|
|
|
|
// Main process that starts all other sub processes
|
|
const main = async () => {
|
|
// Initiate client object
|
|
const client = new Client({
|
|
intents,
|
|
});
|
|
|
|
// Start database manager
|
|
await database()
|
|
.then(async () => {
|
|
await logger.silly("Database process started");
|
|
})
|
|
.catch(async (err) => {
|
|
await logger.error(err);
|
|
});
|
|
|
|
// Start schedule manager
|
|
await schedules(client)
|
|
.then(async () => {
|
|
await logger.silly("Schedules process started");
|
|
})
|
|
.catch(async (err) => {
|
|
await logger.error(err);
|
|
});
|
|
|
|
// Start command handler
|
|
await commands(client)
|
|
.then(async () => {
|
|
await logger.silly("Commands process started");
|
|
})
|
|
.catch(async (err) => {
|
|
await logger.error(err);
|
|
});
|
|
|
|
// Start event handler
|
|
await events(client)
|
|
.then(async () => {
|
|
await logger.silly("Events process started");
|
|
})
|
|
.catch(async (err) => {
|
|
await logger.error(err);
|
|
});
|
|
|
|
// Authorize with Discord's API
|
|
await client.login(token);
|
|
};
|
|
|
|
await main()
|
|
.then(async () => {
|
|
await logger.silly("Main process started");
|
|
})
|
|
.catch(async (err) => {
|
|
await logger.error(err);
|
|
});
|