console.log()
function in the Code Card to print messages to the Botpress Logs. This function takes a string as an argument and prints it to the Botpress Logs.
env
variables can help ensure that the bot is using the correct configurations.
Example use-case: Troubleshooting connectivity or access issues with external services. By logging the API key or endpoint, you can ensure you’re using the correct configurations and not accidentally hitting a production database during development or vice versa.
Property | Description |
---|---|
Type | A string property that indicates the type of the message (text, audio, video, etc.) |
Channel | A string property that specifies the channel or platform through which the message was received. For example, the channel can be an emulator, Facebook Messenger, WhatsApp, etc. |
Direction | A string property that specifies the direction of the message-whether the message is incoming or outgoing. |
Payload | A JSON object that encapsulates the message data. The structure of the payload object depends on the type of message. |
UserId | A string property that identifies the user who sent the message. |
BotId | A string property that identifies the bot or conversational AI system that received the message. |
CreatedOn | A timestamp that specifies the date and time when the message was received. |
ConversationId | A string property that identifies the conversation thread to which the message belongs. |
ID | A unique identifier for the message. |
Preview | A preview or summary of the message. |
MessageId | A string property that identifies the ID of the message. |
Tags | An object that contains tags associated with the message. |
Flags | An object that contains flags associated with the message. |
State | An object that contains the state of the conversation. |
Suggestions | An array of suggested responses or actions that the bot can take based on the message. |
NLU | An object that encapsulates the results of the natural language understanding (NLU) process for the message. |
Decision | An object that encapsulates the decision-making process for the message. |