https://discord.gg/botpress logo
i cant query the kb when sending a virtual message...
# 🤝help
g
hi, i have been trying to send a virtual message into my chatbot for it to query the kb and respond. the problem is that it sends a message that my bot cant see in {{event.preview}} however i can access the content using {{event.payload.content}} but i cant query this against the kb. when i try it says in the logs: 'skipping kb agent as user didnt send a message'. Also, i can see whats being sent when i look at the 'conversations' tab in the workspace, and it appears in the transcipt variable. https://cdn.discordapp.com/attachments/1259866090788487290/1259866091363237898/Screenshot_2024-07-08_at_14.00.33.png?ex=668d3d3b&is=668bebbb&hm=5cde3e2c7f7d1dac763cb2071030842c739683a3a4c31923d9e7eaa78f7c800d& https://cdn.discordapp.com/attachments/1259866090788487290/1259866091778216029/Screenshot_2024-07-08_at_14.35.14.png?ex=668d3d3b&is=668bebbb&hm=908426b102d452235674c6cb3bdabb627d3f4551b301441fd25fb580560bc354& https://cdn.discordapp.com/attachments/1259866090788487290/1259866092377997413/Screenshot_2024-07-08_at_14.36.16.png?ex=668d3d3b&is=668bebbb&hm=042eeab6108f2fcedd700bddfdee7e5c3e3cfb0726c3bdb189aa6ee9a4236325&
import axios from 'axios'; const options = { method: 'POST', url: 'https://api.botpress.cloud/v1/chat/messages', headers: { accept: 'application/json', 'x-integration-id': '87b01760-ede8-49d5-afc6-6afc0d0d1bdb', 'x-bot-id': '73a2700e-f938-4dc7-a362-6877ca2ab4c1', 'content-type': 'application/json', authorization: 'Bearer bp_pat_R0TvhpZny0m6IgK9GLfJF1n6g2C3b5dTDuTL' }, data: { payload: {type: 'text', content: 'what do you offer?'}, tags: {'webchat:id': 'ca3f3bbe-da70-4222-85be-380461f3dd0c'}, userId: 'user_01J1TCGS48BBDWR8V30MZFYPD5', conversationId: 'conv_01J1TCGS0J5VA4Z4T2G4BN9XBE', type: 'text' } }; axios .request(options) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.error(error); });
import axios from 'axios'; const options = { method: 'POST', url: 'https://api.botpress.cloud/v1/chat/messages', headers: { accept: 'application/json', 'x-integration-id': '87b01760-ede8-49d5-afc6-6afc0d0d1bdb', 'x-bot-id': '73a2700e-f938-4dc7-a362-6877ca2ab4c1', 'content-type': 'application/json', authorization: 'Bearer bp_pat_R0TvhpZny0m6IgK9GLfJF1n6g2C3b5dTDuTL' }, data: { payload: {type: 'text', content: 'what do you offer?'}, tags: {'webchat:id': 'ca3f3bbe-da70-4222-85be-380461f3dd0c'}, userId: 'user_01J1TCGS48BBDWR8V30MZFYPD5', conversationId: 'conv_01J1TCGS0J5VA4Z4T2G4BN9XBE', type: 'text' } }; axios .request(options) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.error(error); });
2 Views