Categories:
Actions managed by redirect command
Description of the redirect command, in charge of sending a message to Aura Groot when this command is received by Aura Bridge
Introduction
Certain actions can be performed by aura-bridge when a specific command is received. Currently, only the redirect command is implemented in the plugins that manage messages from aura-groot:
- directline-whatsapp-processor plugin
- directline-rcs-processor plugin
Redirect command
The redirect command allows sending a message to aura-groot when a message with this command is received by aura-bridge from aura-groot. For example, if you want to launch an intent after login in aura-groot. In this case, aura-bot needs to receive the new requested intent from outside to relaunch and complete the authentication flow.
The format of an action message is the following:
- In channelData V3:
{
"type":"message",
"channelData":{
"actions":[
{
"target":"bridge",
"name":"REDIRECT.COMMAND",
"params":{
"auraCommand":{
"type":"suggestion",
"value":{
"intent":"intent.common.greetings"
}
}
}
}
]
},
"inputHint":"ignoringInput"
}
- In channelData V1:
{
"type": "message",
"channelData": {
"customData": {
"type": "redirect",
"action": "REDIRECT.COMMAND",
"data": {
"auraCommand": {
"type": "suggestion",
"value": {
"intent": "intent.common.greetings"
}
}
}
},
},
"inputHint": "ignoringInput"
}
In this example, if aura-bridge receives this message, it will send an auraCommand with the intent intent.common.greetings to aura-groot.
Redirect command in directline-whatsapp-processor plugin
The directline-whatsapp-processor plugin can behave in different ways depending on the message containing the REDIRECT.COMMAND action:
- aura-groot message contains text in the
textfield: In this scenario, in addition to sending the message to the bot with theREDIRECT.COMMANDinformation, a message will be sent to WhatsApp with that text.
graph LR
A(aura-groot) -->|Redirect message| B(Bridge)
B -->|Whatsapp user message| W[Whatsapp]
B -->|Redirect message| A
- aura-groot message does not contains text (empty) in the
textfield:
In this scenario, only one message will be sent to the bot with theREDIRECT.COMMANDinformation. No message will be sent to the WhatsApp user.
graph LR
A(aura-groot) -->|Redirect message with empty text| B(Bridge)
B -->|Redirect message| A
The same process is followed in the directline-rcs-processor plugin.