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

Repair the 'lock/unlock' and 'archive/unarchive' thread effects #195

Closed antbluedz closed 3 months ago

antbluedz commented 3 months ago

Versions

Description

The 'lock/unlock' and 'archive/unarchive' expressions just don't work.

How it was used:

command /testdisky_a:
    trigger:
        unarchive thread with id "xxxx"
        unlock thread with id "xxxx"

What it does: Nothing, and I have no error in the console, nor when reloading. What I expected: That it archive/unarchive the thread.

EquipableMC commented 3 months ago

Sky is aware of the issue, but thank you for opening the issue request so he can remember to fix it in DiSky 4.16.1 or whatever the new version is!

ItsTheSky commented 3 months ago

The problem here is not the effect itself, but the threads;

Archived threads are not cached anymore, thus we can't get them, we have to retrieve them. For discord commands, DiSky cannot handle retrieving, as they do not run async (they're the same as Minecraft commands).

To make it work, you'll have to retrieve the thread by its ID instead of getting it.

antbluedz commented 3 months ago

I can't retrieve them.

retrieve all threads from {_guild} and store the threads in {_threads::*} => {_threads::*} gives me an empty list

And in the Disky Wiki, it says:

Retrieve every threads (and cache them) from a specific guild. This effect will only get back the ACTIVE thread, and will pass on the archived ones.

ItsTheSky commented 3 months ago

That's because you can't retrieve archived threads of a guild. Discord only allows us to retrieve archived threads for a forum channel

antbluedz commented 3 months ago

I have a problem with retrieve threads.

It doesn't retrieve all threads from a channel. Just some of them.

And I don't understand why. They don't differ in their creation date, or in their other attributes (tags/lock/unlock/archived/...).

What i used:

command /testdisky:
    trigger:
        retrieve all threads from forum channel with id "xxx" and store the threads in {_threads::*}
        loop {_threads::*}:
            set {_thread} to loop-value
            set {_thread_id} to discord id of {_thread}
            send "%{_thread}%"

And I have no errors in the console.

ItsTheSky commented 3 months ago

Yes, it only retrieves archived threads if you specify a forum channel:

antbluedz commented 3 months ago

Okay, fine. Thank you!