merge dev to main #168
2 changed files with 10 additions and 3 deletions
|
@ -1,10 +1,12 @@
|
|||
const isDev = process.env.NODE_ENV !== "production";
|
||||
|
||||
/** Load the app */
|
||||
const start_app = () => {
|
||||
import("./load").then((l) => l.run().catch((error) => console.error(error)));
|
||||
import("./load").then((l) => l.run(isDev).catch((error) => console.error(error)));
|
||||
};
|
||||
|
||||
// Load .env if not in prod
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
if (isDev) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
import("dotenv").then((c) => {
|
||||
|
|
|
@ -7,13 +7,18 @@ import loadClient, { quit } from "./utils/client";
|
|||
import { logStart } from "./utils/misc";
|
||||
|
||||
/** Run the bot */
|
||||
export const run = async () => {
|
||||
export const run = async (isDev: boolean) => {
|
||||
console.log("Starting Botanique...");
|
||||
|
||||
// Client Discord.JS
|
||||
const client_name = "Client";
|
||||
await loadClient()
|
||||
.then(async (client) => {
|
||||
if (isDev) {
|
||||
// Attach debugging listeners
|
||||
client.on("debug", console.log).on("warn", console.warn);
|
||||
}
|
||||
|
||||
// Events Discord.JS and Player
|
||||
const events_name = "Events";
|
||||
await loadEvents(client)
|
||||
|
|
Loading…
Reference in a new issue