sern-handler / handler

Create your dream Discord bot!
https://sern.dev
MIT License
38 stars 9 forks source link

[BUG] RxJS Error When You Don't Export every command/event module #301

Closed Murtatrxx closed 1 year ago

Murtatrxx commented 1 year ago

Describe the bug RxJS error when you don't implement every command/event module.

To Reproduce Steps to reproduce the behavior:

  1. Try to create some event files
  2. Make some of them empty
  3. See error

Expected behavior Ignoring not module exporting files could be better

Screenshots (none)

Versioning Node.js version: v16 discord.js version: v14.7 @sern/handler version: v2.6.2 Channel: stable

Additional context (none)

jacoobes commented 1 year ago

Here's my proposed solution. there will be two modes: DEV and PROD. In prod mode, this is normal behavior because empty files should not exist in a bot. This can be overrided however, if you add -ignore! to the end of the filename. In DEV mode, any file that is ignored is logged so the developer knows.

Murtatrxx commented 1 year ago

Okay, but in PROD mode, you may consider adding a better error message, at first glance it's impossible to understand what's causing it.

jacoobes commented 1 year ago

I plan on improving error messages overall

jacoobes commented 1 year ago

294

Murtatrxx commented 1 year ago

👍

jacoobes commented 1 year ago

Planning on changing it to something simpler:

Adding a ! in front of file or directory tells sern to ignore loading it.

Also, not sure about dev and prod mode. might be too invasive