> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-llms-scoped-indexes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Scheduler Message

> Scheduler Message — CometChat documentation.

The `SchedulerMessage` class is used to create an interactive scheduler message that can be sent via CometChat. It extends the [Interactive Messages](/sdk/javascript/interactive-messages) class from CometChat.

### Properties

| Name | Type | Description |
| - | - | - |
| receiverId | string | The ID of the receiver |
| receiverType | string | The type of the receiver. |
| title | string | The title of the scheduler message. |
| scheduleElement | ButtonElement | The schedule button of the scheduler message. |
| goalCompletionText | string | The text visible after completion of goal. |
| interactions | [Interaction](/sdk/javascript/interactive-messages#interaction) | Gives the list of elements you have interacted with |
| allowSenderInteraction | boolean | Allows the sender interaction. default value is false. |
| avatarUrl | string | url to set avatar in scheduler message. |
| timezoneCode | string | the code for setting timezone according to which availability is set |
| bufferTime | string | The buffer time added between events. |
| duration | string | The time duration for the time slots. |
| availability | Availability | The date time range for availability in different days. |
| dateRangeStart | string | Date from which event can be scheduled. |
| dateRangeEnd | string | Date upto which event can be scheduled. |
| icsFileUrl | string | url to access ics file which can tell the schedule of message sender. |

### Class Usage

How to create an instance of the [Scheduler Message](/web-shared/scheduler-message) class:

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    // Create an instance of APIAction
    let apiAction = new APIAction("https://example.com/api", "POST");

    // Create an instance of ButtonElement
    let scheduleButton = new ButtonElement("1", apiAction, "Submit");


    // Create a new instance of SchedulerMessage

    let schedulerMessage = new SchedulerMessage("receiverId", CometChat.RECEIVER_TYPE.USER, {
    availability: { "monday": [{ from: "1200", to: "1600" }], "friday": [{ from: "0600", to: "1000" }] },
    title:"title",
    scheduleElement: scheduleButton
    });
    ```
  </Tab>
</Tabs>

### Key Properties and Methods

#### Goal Completion Text

The `setGoalCompletionText()` method sets the goal completion text of the scheduler.

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    let schedulerMessage = new SchedulerMessage("receiverId", CometChat.RECEIVER_TYPE.USER, {
     availability: { "monday": [{ from: "1200", to: "1600" }], "friday": [{ from: "0600", to: "1000" }] },
     title: ""
    });

    schedulerMessage.setGoalCompletionText("Goal completed");
    ```
  </Tab>
</Tabs>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.