diff --git a/commands/general/base64.js b/commands/general/base64.js index dfc7f4a6..4e6f4213 100644 --- a/commands/general/base64.js +++ b/commands/general/base64.js @@ -1,3 +1,4 @@ +import { Buffer } from "node:buffer"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; diff --git a/commands/general/broadcast.js b/commands/general/broadcast.js index 1c32fd1d..8ff45ce1 100644 --- a/commands/general/broadcast.js +++ b/commands/general/broadcast.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { endBroadcast, startBroadcast } from "#utils/misc.js"; diff --git a/commands/general/channel.js b/commands/general/channel.js index d8c344f2..ae6a1561 100644 --- a/commands/general/channel.js +++ b/commands/general/channel.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants, GuildChannel } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { safeBigInt } from "#utils/misc.js"; diff --git a/commands/general/command.js b/commands/general/command.js index 0a1df361..2f63863c 100644 --- a/commands/general/command.js +++ b/commands/general/command.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import * as collections from "#utils/collections.js"; diff --git a/commands/general/eval.js b/commands/general/eval.js index 25090f05..028dbad7 100644 --- a/commands/general/eval.js +++ b/commands/general/eval.js @@ -1,3 +1,5 @@ +import { Buffer } from "node:buffer"; +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { clean } from "#utils/misc.js"; diff --git a/commands/general/exec.js b/commands/general/exec.js index 3d00a896..9b243b7c 100644 --- a/commands/general/exec.js +++ b/commands/general/exec.js @@ -1,4 +1,6 @@ +import { Buffer } from "node:buffer"; import { exec as baseExec } from "node:child_process"; +import process from "node:process"; import { promisify } from "node:util"; import { clean } from "#utils/misc.js"; const exec = promisify(baseExec); diff --git a/commands/general/help.js b/commands/general/help.js index 6ecc3589..1197021b 100644 --- a/commands/general/help.js +++ b/commands/general/help.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import paginator from "#pagination"; diff --git a/commands/general/imagereload.js b/commands/general/imagereload.js index 4a29ccd7..1c860d8d 100644 --- a/commands/general/imagereload.js +++ b/commands/general/imagereload.js @@ -1,3 +1,4 @@ +import process from "node:process"; import Command from "#cmd-classes/command.js"; import { reloadImageConnections } from "#utils/image.js"; diff --git a/commands/general/info.js b/commands/general/info.js index 6c4f433f..7a128a20 100644 --- a/commands/general/info.js +++ b/commands/general/info.js @@ -1,3 +1,4 @@ +import process from "node:process"; import Command from "#cmd-classes/command.js"; import { getServers } from "#utils/misc.js"; import packageJson from "../../package.json" with { type: "json" }; diff --git a/commands/general/prefix.js b/commands/general/prefix.js index 9c7e3427..321f0d81 100644 --- a/commands/general/prefix.js +++ b/commands/general/prefix.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; diff --git a/commands/general/reload.js b/commands/general/reload.js index e7dfadd8..00029928 100644 --- a/commands/general/reload.js +++ b/commands/general/reload.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import { paths } from "#utils/collections.js"; diff --git a/commands/general/restart.js b/commands/general/restart.js index 8dec8295..1945aaa7 100644 --- a/commands/general/restart.js +++ b/commands/general/restart.js @@ -1,3 +1,4 @@ +import process from "node:process"; import Command from "#cmd-classes/command.js"; class RestartCommand extends Command { diff --git a/commands/general/soundreload.js b/commands/general/soundreload.js index 85b374d9..cbca7b92 100644 --- a/commands/general/soundreload.js +++ b/commands/general/soundreload.js @@ -1,3 +1,4 @@ +import process from "node:process"; import Command from "#cmd-classes/command.js"; import { reload } from "#utils/soundplayer.js"; diff --git a/commands/general/stats.js b/commands/general/stats.js index 4235728c..1f383210 100644 --- a/commands/general/stats.js +++ b/commands/general/stats.js @@ -1,4 +1,5 @@ import os from "node:os"; +import process from "node:process"; import { VERSION } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import packageJson from "../../package.json" with { type: "json" }; diff --git a/commands/music/host.js b/commands/music/host.js index da4f78a7..72d844c7 100644 --- a/commands/music/host.js +++ b/commands/music/host.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants, User } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; import logger from "#utils/logger.js"; diff --git a/commands/music/remove.js b/commands/music/remove.js index 65e669da..4a05a2e6 100644 --- a/commands/music/remove.js +++ b/commands/music/remove.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import MusicCommand from "#cmd-classes/musicCommand.js"; import { queues } from "#utils/soundplayer.js"; diff --git a/commands/tags/tags.js b/commands/tags/tags.js index e66709c5..7a32ea2d 100644 --- a/commands/tags/tags.js +++ b/commands/tags/tags.js @@ -1,3 +1,4 @@ +import process from "node:process"; import { Constants } from "oceanic.js"; import Command from "#cmd-classes/command.js"; import paginator from "#pagination"; diff --git a/src/api/index.ts b/src/api/index.ts index 7c5d82d8..68cb90e3 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,6 +1,8 @@ import "dotenv/config"; +import { Buffer } from "node:buffer"; import EventEmitter from "node:events"; import { createServer } from "node:http"; +import process from "node:process"; import { Client } from "oceanic.js"; import type WebSocket from "ws"; import { WebSocketServer, type ErrorEvent } from "ws"; diff --git a/src/app.ts b/src/app.ts index c0f15c91..5456c641 100644 --- a/src/app.ts +++ b/src/app.ts @@ -19,6 +19,8 @@ esmBot will continue to run past this message in 5 seconds, but keep in mind tha // load config from .env file import "dotenv/config"; +import process from "node:process"; + if (process.env.SENTRY_DSN && process.env.SENTRY_DSN !== "") await import("./utils/sentry.js"); if (!process.env.TOKEN) { diff --git a/src/classes/command.ts b/src/classes/command.ts index 8df47d21..a5f4ea79 100644 --- a/src/classes/command.ts +++ b/src/classes/command.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { type AllowedMentions, type AnyTextableChannel, diff --git a/src/database.ts b/src/database.ts index 56d39fd6..86aead23 100644 --- a/src/database.ts +++ b/src/database.ts @@ -1,5 +1,6 @@ // wrapper for the database drivers in ./database/ import "dotenv/config"; +import process from "node:process"; import type { Guild, GuildChannel } from "oceanic.js"; import logger from "#utils/logger.js"; import { type DBGuild, isError, type Tag } from "#utils/types.js"; diff --git a/src/database/postgresql.ts b/src/database/postgresql.ts index 0c38d4d9..f8420597 100644 --- a/src/database/postgresql.ts +++ b/src/database/postgresql.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import type { Guild, GuildChannel } from "oceanic.js"; import type { DatabasePlugin } from "../database.js"; import { commands, disabledCache, disabledCmdCache, messageCommands, prefixCache } from "#utils/collections.js"; diff --git a/src/database/sqlite.ts b/src/database/sqlite.ts index 27e690eb..7c172b6d 100644 --- a/src/database/sqlite.ts +++ b/src/database/sqlite.ts @@ -1,4 +1,5 @@ import type { Database as BunDatabase, Statement as BunStatement } from "bun:sqlite"; +import process from "node:process"; import type { Database as BSQLite3Database, Options as BSQLite3Options, diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index be82b04e..c346c1e8 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -1,3 +1,5 @@ +import { Buffer } from "node:buffer"; +import process from "node:process"; import { type AnyInteractionGateway, InteractionTypes } from "oceanic.js"; import ImageCommand from "#cmd-classes/imageCommand.js"; import { collectors, commands, messageCommands, selectedImages, userCommands } from "#utils/collections.js"; diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 251ac552..59a0af50 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -1,4 +1,5 @@ -import { type AnyTextableChannel, GroupChannel, type Message, PrivateChannel, ThreadChannel } from "oceanic.js"; +import { Buffer } from "node:buffer"; +import process from "node:process"; import ImageCommand from "#cmd-classes/imageCommand.js"; import { aliases, commands, disabledCache, disabledCmdCache, prefixCache } from "#utils/collections.js"; import { getString } from "#utils/i18n.js"; diff --git a/src/events/ready.ts b/src/events/ready.ts index 1e3b5446..2fc26a2d 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { send } from "#utils/handler.js"; import { createPage, generateList } from "#utils/help.js"; import logger from "#utils/logger.js"; diff --git a/src/pm2/ext.ts b/src/pm2/ext.ts index ec5ebff1..12f7ba17 100644 --- a/src/pm2/ext.ts +++ b/src/pm2/ext.ts @@ -1,6 +1,7 @@ import "dotenv/config"; import { createServer } from "node:http"; import { availableParallelism } from "node:os"; +import process from "node:process"; import { Client, type ShardStatus } from "oceanic.js"; import pm2, { type ProcessDescription } from "pm2"; import winston from "winston"; diff --git a/src/utils/handler.ts b/src/utils/handler.ts index 76548dc4..975166b9 100644 --- a/src/utils/handler.ts +++ b/src/utils/handler.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { aliases, categories, commands, info, messageCommands, paths, userCommands } from "./collections.js"; import { log } from "./logger.js"; diff --git a/src/utils/help.ts b/src/utils/help.ts index 7bb3a820..90c49311 100644 --- a/src/utils/help.ts +++ b/src/utils/help.ts @@ -1,4 +1,5 @@ import { promises } from "node:fs"; +import process from "node:process"; import commandConfig from "#config/commands.json" with { type: "json" }; import { commands, info } from "./collections.js"; import type { Param } from "./types.js"; diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index c79754cc..eeccbd17 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { locales } from "./collections.js"; const templateRegex = /{{(\w+?)}}/g; diff --git a/src/utils/image-runner.ts b/src/utils/image-runner.ts index 7eb0389f..b409e52a 100644 --- a/src/utils/image-runner.ts +++ b/src/utils/image-runner.ts @@ -1,3 +1,4 @@ +import { Buffer } from "node:buffer"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { img } from "./imageLib.js"; diff --git a/src/utils/image.ts b/src/utils/image.ts index e7c3d4bb..f43b35c3 100644 --- a/src/utils/image.ts +++ b/src/utils/image.ts @@ -1,6 +1,8 @@ +import { Buffer } from "node:buffer"; import { lookup } from "node:dns/promises"; import fs from "node:fs"; import { createRequire } from "node:module"; +import process from "node:process"; import { fileTypeFromBuffer } from "file-type"; import ipaddr from "ipaddr.js"; import ImageConnection from "./imageConnection.js"; diff --git a/src/utils/imageConnection.ts b/src/utils/imageConnection.ts index c7a83fc1..6181072e 100644 --- a/src/utils/imageConnection.ts +++ b/src/utils/imageConnection.ts @@ -1,3 +1,4 @@ +import { Buffer } from "node:buffer"; import { setTimeout } from "node:timers/promises"; import WebSocket, { type Data, type ErrorEvent } from "ws"; import logger from "./logger.js"; diff --git a/src/utils/imageLib.ts b/src/utils/imageLib.ts index 711bf2d4..3cd6d130 100644 --- a/src/utils/imageLib.ts +++ b/src/utils/imageLib.ts @@ -1,4 +1,5 @@ import { createRequire } from "node:module"; +import process from "node:process"; const nodeRequire = createRequire(import.meta.url); const relPath = `../../build/${process.env.DEBUG && process.env.DEBUG === "true" ? "Debug" : "Release"}/image.node`; diff --git a/src/utils/imagedetect.ts b/src/utils/imagedetect.ts index 0b0b56ec..7d99c62e 100644 --- a/src/utils/imagedetect.ts +++ b/src/utils/imagedetect.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import { AttachmentFlags, type Client, diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 6b39ddcb..e14d82f2 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import winston from "winston"; import "winston-daily-rotate-file"; diff --git a/src/utils/misc.ts b/src/utils/misc.ts index f35e9b76..1ccac0f0 100644 --- a/src/utils/misc.ts +++ b/src/utils/misc.ts @@ -1,4 +1,5 @@ import util from "node:util"; +import process from "node:process"; const pm2 = process.env.PM2_USAGE ? (await import("pm2")).default : null; import { type DotenvParseOutput, config } from "dotenv"; import type { AnyChannel, AnyPrivateChannel, Client, CommandInteraction, Message } from "oceanic.js"; diff --git a/src/utils/sentry.ts b/src/utils/sentry.ts index 5b245c83..64942061 100644 --- a/src/utils/sentry.ts +++ b/src/utils/sentry.ts @@ -1,3 +1,4 @@ +import process from "node:process"; import * as Sentry from "@sentry/node"; Sentry.init({ diff --git a/src/utils/soundplayer.ts b/src/utils/soundplayer.ts index 304b05d4..1532872f 100644 --- a/src/utils/soundplayer.ts +++ b/src/utils/soundplayer.ts @@ -1,4 +1,5 @@ import fs from "node:fs"; +import process from "node:process"; import { setTimeout } from "node:timers/promises"; import format from "format-duration"; import { diff --git a/src/utils/tempimages.ts b/src/utils/tempimages.ts index 791c6fb3..ce52b405 100644 --- a/src/utils/tempimages.ts +++ b/src/utils/tempimages.ts @@ -1,4 +1,5 @@ import { lstat, readdir, rm, stat, writeFile } from "node:fs/promises"; +import process from "node:process"; import { type Client, CommandInteraction,