Skip to main content

MessageHandler.handleMessage() method

Parses a raw message.

After the message is parsed, you can decide if it should be saved, and pass the result to dataStoreSaveMessage() to save it.

Signature:

handleMessage(args: IHandleMessageArgs, context: IAgentContext<IDataStore>): Promise<IMessage>;

Parameters

ParameterTypeDescription
argsIHandleMessageArgsThe raw message to be handled along with optional metadata about the origin.
contextIAgentContext<IDataStore>Execution context. Requires agent with IDataStore methods

Returns:

Promise<IMessage>