ScheduledEventRecurrenceRule

interface ScheduledEventRecurrenceRule

How a scheduled event repeats. Discord supports a limited set of patterns: daily (optionally on chosen weekdays), weekly or every other week on one weekday, monthly on the nth weekday (such as the second Tuesday), and yearly on a date.

// Every Friday
recurrenceRule: { start, frequency: "weekly", interval: 1, byWeekday: [4] }

Properties

Property

Type

Description

byMonth?

number[]

For yearly events: months, where 1 is January.

byMonthDay?

number[]

For yearly events: days of the month.

byNWeekday?

{ day: number; n: number }[]

For monthly events: the week of the month ( n , 1-5) and weekday (0 is Monday).

byWeekday?

number[]

Weekdays, where 0 is Monday and 6 is Sunday.

count?

number | null

Number of occurrences before stopping.

end?

Date | null

When the recurrence stops, or omit to repeat indefinitely.

frequency

"yearly" | "monthly" | "weekly" | "daily"

interval

number

Repeat every interval periods. Weekly events allow 1 or 2; others must be 1.

start

Date

When the first occurrence starts. Must match the event’s start time.