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 13 forks source link

Open private channel #104

Closed Notialys closed 1 year ago

Notialys commented 1 year ago

Good evening, with version 4.7 of Disky, I encounter a problem with private messages, when the person has private messages disabled, it returns an error on the console and we cannot even broadcast the variable.

open private channel of event-user and store it in {_channel} broadcast {_channel} if {_channel} is not set: reply with "Please enable your private messages!" else: post "Hello world!" to {_channel}

chrome_oC6O1xDayA

Thank you, if you have a solution for me.

Notialys commented 1 year ago

I just tried with version 4.8 and it seems that the variable does not empty, private message closed, it returns the console error.

chrome_jQvGylHNZt

Mushkrem commented 1 year ago

It's impossible to check if you can send a message to a user before sending it. You can, however, check if the message was sent with a last disky exception expression, eg:

open private channel of event-user and store it in {_channel}
post "1" to {_channel}
if last disky exception is set:
    reply with "Message couldn't be sent."
Notialys commented 1 year ago

I tried and it works, thank you very much.