DiSkyOrg / DiSky

The best Skript add-on for Discord management! Slash commands, interaction, components, modal and much more available!
https://disky.me/
Apache License 2.0
42 stars 12 forks source link

Moves Discord Command parsing to `Load` phase from `init` phase #174

Closed bessel28 closed 4 months ago

bessel28 commented 4 months ago

The skript parser calls init when parsing the structures for the first time, but before the structures are actually loaded. So because CommandFactory.add() uses SkriptUtils.loadCode(trigger, CommandEvent.class) when creating the CommandObject it causes the trigger code to be loaded before any function references have been registered (as that happens in the preload phase.

Fixes https://github.com/DiSkyOrg/DiSky/issues/173

bessel28 commented 4 months ago

oops

ItsTheSky commented 4 months ago

LGTM, thanks for your contribution! ❤️