Added dev script for ts-node

This commit is contained in:
2023-12-30 00:03:32 +01:00
parent 7d7b44412e
commit efa45e7db9
12 changed files with 89 additions and 59 deletions

View File

@@ -3,12 +3,13 @@ import { Button } from "../../interfaces"
import { Events } from "discord.js"
import path = require("path")
import fs = require("fs")
import { FileType } from "../../typings"
function loadButtonEvents(client: Client) {
function loadButtonEvents(client: Client, ft: FileType) {
const btnPath = path.join(__dirname, "..", "..", "events", "buttons")
const btnFiles = fs
.readdirSync(btnPath)
.filter(file => file.endsWith(".js"))
.filter(file => file.endsWith(ft))
for (const file of btnFiles) {
const filePath = path.join(btnPath, file)