Skip to content

commands

orciument edited this page Nov 16, 2024 · 1 revision

A Twitch Command is usually a predefined text that is posted into the Chat when the Command is triggered by another users Chatmessage.

Our Commands extend this default model with quality of life and management functionalities, but a Commands still consists of these two pieces, the output Texts, and the conditions for triggering the Command, like the Regex Matcher/trigger word, the cooldown and permissions. If all conditions are met, the output is evaluated for String Templates and send into the Chat.

Definition of terms

This is a short list of definitions of specific terms that are used in this document to help alleviate confusion.

Message

A Message consists of a message Text, a timestamp, sent by a specific User, which has a certain set of roles and is uniquely identifiable via a username and/or a userId

Command

A Command is a set of Requirements for a message to adhere to to trigger a action of some kind.

Pattern

A Pattern is a specific structure that the text of a message need to adhere to to be a valid match for this command. This Pattern can be a Regex that either matches the message, or rejects it. One, or a List of Patterns is one of the requirements for a message to be a valid match for a command

Cooldown

A Cooldown is a requirement that restricts a single, or a set of users from using the same command again for a specific time, or other kind of duration. This restriction can be based on a number of different factors, most often, the time between the current message and the last successful use of the command, or the number of messages between the last successfull command use, and the current message

Text-Command

A Text-Command is a subset of all commands where the action taken is sending some text into the stream the message came from. This is the conventional command most users think of when thinking of a "twitch command"

User created text commands

Specify Commands in code

---

A Command can either be triggered by a simple !example command, or a mod defined Regex matcher. Under the Hood the simple ! Command is translated into a Regex Matcher.

Clone this wiki locally