It actually didnt work so I'm just switching to require()
This commit is contained in:
parent
ddf4c4910a
commit
31a8fedf2d
@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "linkup-bot-lib",
|
"name": "linkup-bot-lib",
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"main": "lib/Client.js",
|
"main": "lib/Client.js",
|
||||||
"types": "lib/*.ts",
|
"types": "lib/*.ts",
|
||||||
"type": "module",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "typedoc",
|
"prepublishOnly": "typedoc",
|
||||||
"build": "typedoc"
|
"build": "typedoc"
|
||||||
|
@ -377,7 +377,7 @@ export class Client extends TypedEventEmitter<LinkUpEvents> {
|
|||||||
const commands = await promisify(glob)(normalize(path + "/**/*.{ts,js}"));
|
const commands = await promisify(glob)(normalize(path + "/**/*.{ts,js}"));
|
||||||
for (const commandPath of commands) {
|
for (const commandPath of commands) {
|
||||||
try {
|
try {
|
||||||
let command: MaybeCommand = await import(commandPath);
|
let command: MaybeCommand = await require(commandPath);
|
||||||
if ('default' in command) command = command.default;
|
if ('default' in command) command = command.default;
|
||||||
if (command.constructor.name === 'Object') command = Object.values(command)[0];
|
if (command.constructor.name === 'Object') command = Object.values(command)[0];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user