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

Functions cannot be used in a bot definition's On Ready Section #177

Closed bessel28 closed 4 months ago

bessel28 commented 4 months ago

Looks like it's caused by the same issue as #173 where SkriptUtils.loadCode() is being called during the init phase of skript parsing instead of load. This happens at: https://github.com/DiSkyOrg/DiSky/blob/7c39beea971155de2d18c67f9b51736cd1f043aa/src/main/java/info/itsthesky/disky/structures/scope/BotScope.java#L206-L208

While looking for the cause of the problem I also found that disky is seemingly registering the define [the] [new] bot (with name|named) %string% pattern twice, once for an Event in BotScope and once as a Structure in StructBot. Because SelfRegisteringSkriptEvent is now deprecated in favor of Structures should they be merged into 1 structure?

EquipableMC commented 4 months ago

I will look into this for sky and pass some more needed info related to potentially merging them (if it's possible)

bessel28 commented 4 months ago

I will look into this for sky and pass some more needed info related to potentially merging them (if it's possible)

I'm actually looking into this deeper and it looks like although they are 2 separate things that register the same structure only 1 is active at a time. Looks like the BotScope was for Skript 2.6 and StructBot for newer skript versions. Idk if this is just an issue with the old version not being disabled or if StructBot is just unfinished

EquipableMC commented 4 months ago

I will look into this for sky and pass some more needed info related to potentially merging them (if it's possible)

I'm actually looking into this deeper and it looks like although they are 2 separate things that register the same structure only 1 is active at a time. Looks like the BotScope was for Skript 2.6 and StructBot for newer skript versions. Idk if this is just an issue with the old version not being disabled or if StructBot is just unfinished

ahh alright, what is your discord if you dont mind me asking?

bessel28 commented 4 months ago

I will look into this for sky and pass some more needed info related to potentially merging them (if it's possible)

I'm actually looking into this deeper and it looks like although they are 2 separate things that register the same structure only 1 is active at a time. Looks like the BotScope was for Skript 2.6 and StructBot for newer skript versions. Idk if this is just an issue with the old version not being disabled or if StructBot is just unfinished

ahh alright, what is your discord if you dont mind me asking?

Just bessel

EquipableMC commented 4 months ago

your dms are closed and I cant add you

bessel28 commented 4 months ago

your dms are closed and I cant add you

Oops I've just enabled them for disky's server

ItsTheSky commented 4 months ago

Fixed with the "rework" of the scope into a structure.