Raven

Raven

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.

A weekly agent message

To schedule one of your own messages from the message box, see Schedule messages instead.

Only System Managers can create, change or delete recurring agent messages, in Settings > Scheduled Messages. Ask one to do it.

Create a recurring message

Create the agent first, in Settings > Agents.

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

The name can't be changed after you create the message, and 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 time zone.

The message

The Message takes bold, italic, lists, quotes, code and links. It 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.

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 a message with a bold line and a list, the script looks like this:

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

agent.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

Open the message in Settings > Scheduled Messages and click ⋮ next to Save. Disable pauses it and Enable starts it again. Delete removes it.

Last updated 2 weeks ago
Was this helpful?
Thanks!