Removed unneeded const
This commit is contained in:
@@ -6,10 +6,9 @@ import { IAutocomplete } from "~/interfaces"
|
|||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
import logToChannel from "~/utils/Functions/logtochannel.js"
|
import logToChannel from "~/utils/Functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadAutocompleteEvents(client: Client, ft: FileType) {
|
export default async function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||||
const autocompletePath = path.join(__dirname, "..", "..", "components", "autocomplete")
|
const autocompletePath = path.join(import.meta.dirname, "..", "..", "components", "autocomplete")
|
||||||
const autocompleteFiles = fs.readdirSync(autocompletePath).filter(file => file.endsWith(ft))
|
const autocompleteFiles = fs.readdirSync(autocompletePath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of autocompleteFiles) {
|
for (const file of autocompleteFiles) {
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { IButton } from "~/interfaces"
|
|||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
import logToChannel from "~/utils/Functions/logtochannel.js"
|
import logToChannel from "~/utils/Functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadButtonEvents(client: Client, ft: FileType) {
|
export default async function loadButtonEvents(client: Client, ft: FileType) {
|
||||||
const btnPath = path.join(__dirname, "..", "..", "components", "buttons")
|
const btnPath = path.join(import.meta.dirname, "..", "..", "components", "buttons")
|
||||||
const btnFiles = fs.readdirSync(btnPath).filter(file => file.endsWith(ft))
|
const btnFiles = fs.readdirSync(btnPath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of btnFiles) {
|
for (const file of btnFiles) {
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { ICommand } from "~/interfaces"
|
|||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
import logToChannel from "~/utils/Functions/logtochannel.js"
|
import logToChannel from "~/utils/Functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
export default async function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||||
const cmdPath = path.join(__dirname, "..", "..", "commands")
|
const cmdPath = path.join(import.meta.dirname, "..", "..", "commands")
|
||||||
const cmdFiles = fs.readdirSync(cmdPath).filter(file => file.endsWith(ft))
|
const cmdFiles = fs.readdirSync(cmdPath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of cmdFiles) {
|
for (const file of cmdFiles) {
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { IContextMenu } from "~/interfaces"
|
|||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
import logToChannel from "~/utils/Functions/logtochannel.js"
|
import logToChannel from "~/utils/Functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadContextMenuEvents(client: Client, ft: FileType) {
|
export default async function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||||
const contextMenuPath = path.join(__dirname, "..", "..", "commands-contextmenu")
|
const contextMenuPath = path.join(import.meta.dirname, "..", "..", "commands-contextmenu")
|
||||||
const contextMenuFiles = fs.readdirSync(contextMenuPath).filter(file => file.endsWith(ft))
|
const contextMenuFiles = fs.readdirSync(contextMenuPath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of contextMenuFiles) {
|
for (const file of contextMenuFiles) {
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ import fs from "fs"
|
|||||||
import path from "path"
|
import path from "path"
|
||||||
import { ICron } from "~/interfaces"
|
import { ICron } from "~/interfaces"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadCronEvents(ft: FileType) {
|
export default async function loadCronEvents(ft: FileType) {
|
||||||
const cronPath = path.join(__dirname, "..", "..", "events", "cron")
|
const cronPath = path.join(import.meta.dirname, "..", "..", "events", "cron")
|
||||||
const cronFiles = fs.readdirSync(cronPath).filter(file => file.endsWith(ft))
|
const cronFiles = fs.readdirSync(cronPath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of cronFiles) {
|
for (const file of cronFiles) {
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
|
|
||||||
export default async function loadEvents(client: Client, ft: FileType) {
|
export default async function loadEvents(client: Client, ft: FileType) {
|
||||||
const serverDir = path.join(__dirname, "..", "..", "events", "server")
|
const serverDir = path.join(import.meta.dirname, "..", "..", "events", "server")
|
||||||
const eventDirs = fs.readdirSync(serverDir)
|
const eventDirs = fs.readdirSync(serverDir)
|
||||||
for (const eventDir of eventDirs) {
|
for (const eventDir of eventDirs) {
|
||||||
const eventFiles = fs.readdirSync(path.join(serverDir, eventDir)).filter(file => file.endsWith(ft))
|
const eventFiles = fs.readdirSync(path.join(serverDir, eventDir)).filter(file => file.endsWith(ft))
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { IModal } from "~/interfaces"
|
|||||||
import { ExtendedClient as Client } from "~/utils/Client.js"
|
import { ExtendedClient as Client } from "~/utils/Client.js"
|
||||||
import logToChannel from "~/utils/Functions/logtochannel.js"
|
import logToChannel from "~/utils/Functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
|
||||||
|
|
||||||
export default async function loadModalEvents(client: Client, ft: FileType) {
|
export default async function loadModalEvents(client: Client, ft: FileType) {
|
||||||
const modalPath = path.join(__dirname, "..", "..", "components", "modals")
|
const modalPath = path.join(import.meta.dirname, "..", "..", "components", "modals")
|
||||||
const modalFiles = fs.readdirSync(modalPath).filter(file => file.endsWith(ft))
|
const modalFiles = fs.readdirSync(modalPath).filter(file => file.endsWith(ft))
|
||||||
|
|
||||||
for (const file of modalFiles) {
|
for (const file of modalFiles) {
|
||||||
|
|||||||
Reference in New Issue
Block a user