merge dev to main #168

Merged
Anri merged 4 commits from dev into main 2024-09-17 19:33:26 +02:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit 30fe586e66 - Show all commits

View file

@ -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) => {

View file

@ -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)