https://discord.gg/botpress logo
Messaging from and Action
# 🤝help
a
I've created a new Action in order to build a custom API call. It is working, but the Action does a lot of steps to load the data, parse, etc. and I woudl like to message the user to give them a status update (e.g. "Now I'm loading the data, hold on it will take a minute..."). Is there a way for the message to access the chat object and send a message? Something like bp.dm.message("My message");
p
You can try something like this:
Copy code
js
response.data.conversations.forEach((conversation) => {
  const conversationId = conversation.id
  client.createMessage({
    conversationId,
    userId: botId,
    tags: {},
    type: 'text',
    payload: {
      text: "Don't forget to drink water!", // Your reminder message
    },
  })
})
(This code snippet is from the sending reminders tutorial.)
2 Views