The satori global contains the context relevant to the state of the bot user designated as Satori. It extends the bot context type.
The additional addMessageHandler field contains a function for adding handlers to the message processing of Satori. This can be used to alter the body text of a message, such as done by the booru Sense, or to process messages in an arbitrary, non-command invoked manner, such as done by the urlmeta and deepl Senses.
addMessageHandler(handler: function, afterCommand: boolean = false): ()
true
and a command was successfully invoked, the handler will not be executed.This function has no return values.
Message handlers are a type of callback that can be used to intercept the message processing pipeline.
handler(message: table, isSelf: boolean): (result: string|boolean|nil)
~
alias for the img
command. A boolean value of false
will abort the handler pipeline, true
behaves the same way as if no return value was given. Any other return value type is ignored.