Conditions

Conditions are used to define when your actions will run, they are the rules that need to be passed to continue execution.

Condition Groups

Conditions are contained within a condition group. When adding multiple conditions to a group the overall group needs to be "passed" before running your action.

You are free to add multiple groups and when you do, the outcome is based on "OR MATCH CONDITIONS" convention. This means if you have multiple groups of conditions only one of those groups needs to pass for your action to run.

You will use condition groups to split up complex rules/conditions and make them easier to understand and debug if you face any issues.

Condition Options

Conditions are based on "Properties", the very first item you will select for a condition is the "Property" drop down. From here, dependent on the condition selected the "Match" will adjust as well as the "Match Value". These allow you to be super specific on what you want your rule to run against and what it should be checking for.

The property type groupings Modr8 supports you building rules against are specified in the table below.

PropertyDescription

Message Properties

Conditions & properties that are related to a message. This could be the text of a message, whether it is a reply to another user or whether it is a forwarded message

Originating User Properties

The originating user is the user who caused the event to happen that Modr8 engine is running its rules against. This could be the person who just sent a message, it could be the user who just joined the chat. You can create matches against the properties of this user such as their username or user id.

Chat Events

These are specific events emitted by the Chat group itself, also known as "Service Messages". These happen typically when a user joins or leaves your chat.

Media Messages

A sub type to the Message Properties, media messages are very varied so we have created a section just for them. If you want to match against "Media" or maybe specific properties of a video or dice roll game you can do so by using this.

By combining multiple types of condition with multiple types of property checks you can see how we can easily build out very broad or very narrow rules and conditions to execute actions.

Managing Action Group Conditions

As discussed in previous sections, an action group can contain many conditions and you are able to have multiple condition groups within your action builder.

When you have multiple condition groups these work with an "OR" condition between them. This means the Modr8 action engine will attempt to match condition group 1 OR condition group 2 OR condition group X. If any of these groups match successfully then your action will run.

But what if you wish your conditions WITHIN a condition group to also match with an "OR" condition? Well, by default you will have noticed when adding multiple conditions to a condition group you see ---- AND --- between them as per the following image.

You will notice in the header of the group it says "Condition Group 1" followed by a drop down stating "Match All Conditions". This is saying all of the conditions within my group 1 must match for this group to be a true match. We can switch that drop down to "Match Any Condition" and we will now have an "---- OR ----" show between the conditions. This means I want any of the following conditions to be true and then if so my overall group is a true match to run my action.

When is the best time to use "Match Any Condition" vs. Creating a new condition group? Honestly, it is a case by case basis and sometimes you just have to review the use-case you are trying to fulfill. For now, it is good to know you have this option available to you!

Last updated