Matcher

Description

Determines if a CommandLike should run or not. When it is called, it is passed the Context which is then returned if the matcher is satisfied

Example

// Custom matcher
const matchLength = (length: number) => (context) => {
  const { content } = context

  if (content.length >= length) {
    return context
  }
}

matchLength(3)

// Matching: "This is a message"
// Not matching: "Hi"

Generics

S
State
M
Message
C
Client