Triggers - yeuai/botscript Wiki

Sorted trigger philosophy.

A trigger is a pattern help bot knows what human is saying.

Triggers should be sorted in a "most specific first" order. That is:

  1. Atomic triggers first. Sort them so that the triggers with the most amount of words are on top. For multiple triggers with the same amount of words, sort them by length, and then alphabetically if there are still matches in length.

  2. Sort triggers that contain optionals in their triggers next. Sort them in the same manner as the atomic triggers.

  3. Sort triggers containing wildcards next. Sort them by the number of words that aren't wildcards. The order of wildcard sorting should be as follows:

    A. Alphabetic wildcards (_)
    B. Numeric wildcards (#)
    C. Global wildcards (*)

  4. The very bottom of the list will be a trigger that simply matches * by itself, if it exists. If triggers of only _ or only # exist, sort them in the same order as in step 3.