✅Validators
Explanation
You can find an example of validator in the "Ping" plugin

In this case, the validator will do some checks specified by the user. If there are no blocks, the action will run. Consider that this will vary a lot depending on the plugin you are using.
After you enter the editor, you will find something like this

In validators, one of the most important blocks, as said before, is the "Continue" in the "Base" category

If this block gets triggered, the action will run.
Example
Now, we will make a validator that checks if the user is typing the /ping
command in the channel bot-commands
.
Now, this is just an example. Don't do it in production!
Step 1
In the logic section, grab an "if" statement and put it under the parent block

Click on the small gear icon and drag the "else" block under the "if" parent.

Step 2
In the same "logic" section, add the "equals" block

On the left side of the statement put a "Name of the channel" block in the "Channels" category

Now, expand the "Interaction" category, select "Variables" and grab the interaction channel object

Now, in the "Text" category grab the "Word" block and put it in the right field of the statement

And put the channel name

Step 3
Now, in the first statement the action will run whenever the condition above is true, in this case the Channel should have the name "bot-commands"
So, if the first condition is satisfied, we will continue, else we will reply to the user saying that he can't do that
In the base category, grab the "Continue" block

Now expand the Interaction category, select "Reply" and drag the "Reply with..." block into the second statement

Change 'ephemeral' to true (this is completely optional)

Congrats! You have created a validator! 🥳
(remember to save)
Demo
Running the command into the bot-commands channel

Running the command not into bot-commands

Last updated
Was this helpful?