prehistoric-airplane-85682
06/16/2025, 8:08 PMjs
const botId = '<your-bot-id>' // Replace with your actual bot ID (found in the URL)
const botpressApiUrl = 'https://api.botpress.cloud/v1/chat/conversations'
const botpressApiKey = env.PERSONAL_ACCESS_TOKEN // Create the variable in bot settings under Configuration Variables
// Create the PAT in the dashboard
const response = await axios.get(botpressApiUrl, {
headers: {
Authorization: `Bearer ${botpressApiKey}`,
'x-bot-id': botId
}
})
// Optional: Log the list of conversations
console.log(response.data)
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
},
})
})
📌 Notes:
* Secure your token: Always use env.PERSONAL_ACCESS_TOKEN, never hardcode it.
* Customize your schedule: You can run the Fixed Schedule card every few minutes, hourly, or daily.
* Conversation-aware logic: Want to only message certain users? Add filters inside the forEach loop.
https://cdn.discordapp.com/attachments/1384263331694776531/1384263331938041906/Screenshot_2025-06-16_at_2.55.25_PM.png?ex=6851cb30&is=685079b0&hm=e1b67b6c137d93218245587deeb2b44cc342e28d8c31055b117f7823a52dd5bf&wooden-beard-40210
06/17/2025, 7:44 AMgifted-doctor-91860
06/22/2025, 9:08 AMprehistoric-airplane-85682
06/23/2025, 2:22 PMgifted-doctor-91860
06/23/2025, 2:25 PMgifted-doctor-91860
06/23/2025, 2:25 PMprehistoric-airplane-85682
06/23/2025, 3:50 PM