List of Events
Some events havesettable attributes, which can be modified by plugin code and used in subsequent LangBot processing.
*MessageReceived
Triggered when any message is received in group chat or private chat.*NormalMessageReceived
Triggered when a group chat or private chat message is received and determined to be a message that needs to be processed by LLM (non-command message).*CommandSent
Triggered when a group chat or private chat command is received.NormalMessageResponded
Triggered when a message receives an LLM response.PromptPreProcessing
Triggered when building the LLM response context (prompt).Event Context APIs
EventContext object, which contains event context information, and the object has both Request API and event context specific APIs. The following is a list of event context specific APIs:
Get Original Event Attributes
event_context.event attribute is the original event object, which can get the attributes of the original event. The type is the type of the event being listened to.
For example, when the event being listened to is GroupMessageReceived:
Prevent Default Behavior
Only the following events can prevent default behavior:
- PersonMessageReceived
- GroupMessageReceived
- PersonNormalMessageReceived
- GroupNormalMessageReceived
- PersonCommandSent
- GroupCommandSent
- NormalMessageResponded
