Open castdrian opened 4 years ago
here's my branch on which I handled this to work somewhat properly https://github.com/gideonbot/discord-akairo/tree/akairo-es6
*doesn't fix the broken destructuring
It is also necessary to make support for files with the extension .mjs
and .cjs
. At the moment, the library does not process files with these extensions.
It is also necessary to make support for files with the extension
.mjs
and.cjs
. At the moment, the library does not process files with these extensions.
You can easily allow that with the extensions
option in the command handler
We could maybe allow cjs
and mjs
extensions, combined with a check: if it's an mjs
, we await import
, otherwise we require
.
As for the importing of Akairo, we could maybe do something like discordjs/discord.js#3998.
Why not just use the import
function for everything?
import
does not support reloading as of the moment. Its not a deal breaker, but I'd rather not touch it for now.
Using latest master & djs master Node 13.11.0:
results in
as workaround you have to do
also the commandhandler uses
require()
on the files instead ofimport
, resulting in