This code is not running on sapphire
Solution:Jump to solution
figured it out, to anyone else that has this problem just add
async
before the run
and also add this code before the async run(client) {}
part
```js
constructor(context, options) {
super(context, {...3 Replies
I don't think the pieces loader really loads properties from
module.exports
, only exports.*
and module.exports
Try module.exports = ReadyListener;
or exports.ReadyListener = ReadyListener;
Alternatively, if you can make the switch to ESM, you'll be able to do export class ReadyListener ...
, which may look less boilerplate-ySolution
figured it out, to anyone else that has this problem just add
async
before the run
and also add this code before the async run(client) {}
part
there was also missing s
in ms()
(below currentStatus = (currentStatus + 1) % statuses.length;
)async doesnt matter if the function doesnt await anything. You should learn what async actually does before you add it to any place willy nilly.
Adding the constructor is purely optional, though you would want to run the ready listener only once so it's a good addition nonetheless.
the syntax error however is an issue because when JS encounters a syntax error it will simply not execute the code
we do support this export syntax.