Raven

Raven

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Recurring agent messages

A recurring agent message is a message an agent posts in a channel on a schedule, such as a reminder every Monday at 9:00 AM. Set them up in Settings > Scheduled Messages.

This is not the same as scheduling one of your own messages from the message box. For that, see Schedule messages.

Create a recurring message

Create the agent first, in Settings > Agents.

  1. Open Settings > Scheduled Messages.
  2. Click Create.
  3. Enter a Name.
  4. In Where do you want to send this?, pick the channel.
  5. In Which agent should send this?, pick the agent.
  6. In How often?, pick Daily, Weekly, Monthly or Custom.
  7. Fill in the schedule fields for that choice.
  8. Write the Message.
  9. Click Create.

A weekly agent message

The name can't be changed after you create the message. It must not match the name of an existing server script.

Schedule options

How often? Fields
Daily At what time?
Weekly At what time? and On which days? Click a day to turn it on or off. Weekdays picks Monday to Friday. Every day picks all seven.
Monthly At what time? and On which day of the month? Days after the 28th are skipped in months that don't have them.
Custom Cron expression: minute, hour, day of month, month, day of week. For example, 30 9 * * 1-5 is 9:30 AM on weekdays.

A line under the schedule says when the message will be sent. Times are in the site timezone.

The message

Write the message in the Message box. Use the toolbar for bold, italic, lists, quotes, code and links. The message is posted exactly as you write it, every time. It can't hold values that change, such as today's date, and it can't mention people.

For example, this message:

Build week. Frames on the stand from nine.

  • Standup at 9:15 in the workshop
  • Paint booth booked from 2:00 PM

is posted every time as a message from the agent, with the same bold text and list.

How it runs

Raven saves each recurring message as a server script of the type Scheduler Event, with the same name. The script runs on the schedule and posts the message as the agent. For the message above, the script looks like this:

bot = frappe.get_doc('Raven Bot', 'Deploys')

bot.send_message('lumen-cycles-workshop', "<p><strong>Build week.</strong> Frames on the stand from nine.</p><ul><li><p>Standup at 9:15 in the workshop</p></li><li><p>Paint booth booked from 2:00 PM</p></li></ul>")

Raven updates the script when you save the recurring message, and deletes it when you delete the message. Change the message in Settings > Scheduled Messages, not in the script.

To post a message that changes each time, write your own server script with an agent instead. See Post as an agent from code.

Pause or delete a recurring message

  1. Open Settings > Scheduled Messages and click the message.
  2. Click ⋮ next to Save.
  3. Click Disable to pause it, or Delete to remove it.

Click Enable in the same menu to start a paused message again.

Last updated 1 week ago
Was this helpful?
Thanks!