Skip to main content
Message Processing Chain Note: You must explicitly call execute() to perform operations

Constructor

Parameters

required
Message
MessageSender
required
Sender

Returns

MessageChain

Methods

do()

Execute custom operation

Parameters

(message: Message) => void | Promise<void>
required
Type: Message

Returns

this

execute()

Execute all operations (explicit call) This is the only method that actually performs operations

Returns

Promise<void>

ifFromMe()

Only process my own messages

Returns

this

ifFromOthers()

Only process messages from others

Returns

this

ifGroupChat()

Only process group chat messages

Returns

this

ifNotReaction()

Only process non-reaction messages (skip tapbacks)

Returns

this

ifReaction()

Only process tapback reactions

Returns

this

ifUnread()

Only process unread messages

Returns

this

matchText()

Match text pattern

Parameters

string | RegExp
required

Returns

this

replyImage()

Reply with image Automatically routes to recipient or group based on message.chatId

Parameters

string | string[] | Mapper<Message, string | string[]>
required

Returns

this

replyText()

Reply with text Automatically routes to recipient or group based on message.chatId

Parameters

string | Mapper<Message, string>
required

Returns

this

when()

Conditional check

Parameters

Predicate<Message>
required

Returns

this