### Root Bot Example: Initialize and Cleanup (TypeScript) Source: https://docs.rootapp.com/docs/bot-docs/develop/server-lifecycle An example showing how to import Root APIs, initialize services and databases in `onStarting`, and perform cleanup or logging in `onStopping` before starting the server lifecycle. ```typescript // Import Root APIs import { rootServer, RootBotStartState } from "@rootsdk/server-bot"; // Import your initialization functions import { initializeMyService } from "./myService"; import { initializeMyDatabase } from "./myDatabase"; // Define your start callback async function onStarting(state: RootBotStartState) { await initializeMyDatabase(); await initializeMyService(); } // Define your stop callback async function onStopping() { const request: CommunityAppLogCreateRequest = { communityAppLogType: CommunityAppLogType.Error, message: "your-message-to-the-community-goes-here" }; await rootServer.datastore.logs.community.create(request); } (async () => { // Register your callbacks, typically only onStarting and onStopping are needed await rootServer.lifecycle.start(onStarting, onStopping); })(); ``` -------------------------------- ### Install Dependencies and Build Root Bot Source: https://docs.rootapp.com/docs/bot-docs/tutorials/welcome-bot/generate-build-test-bot Install the project's dependencies using `npm install` and then compile your bot's code using `npm run build`. These commands are executed from the root of your bot's project directory in the terminal. Ensure Node.js and npm are installed. ```bash npm i npm run build ``` -------------------------------- ### Install Project Dependencies with npm Source: https://docs.rootapp.com/docs/bot-docs/tutorials/announce-bot/generate-build-test-bot Installs all the necessary project dependencies defined in the `package.json` file. This command must be run before building or running the bot. ```bash npm i ``` -------------------------------- ### Bot Manifest Server Launch Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference An example of the 'launch' property within the 'server' configuration of a bot manifest. This string specifies the entry point file for the bot server, which must be a .js file. ```string "dist/myBotMain.js" ``` -------------------------------- ### Bot Manifest Structure Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference An example of a complete bot manifest file, showcasing the basic structure and common properties like id, version, and package configuration. ```json { "id": "ACj4U-eThgmjXUOBAjk_jw", "version": "1.0.0", "package": { "server": { "launch": "dist/myBotMain.js", "deploy": [ "dist" ], "node_modules": [ "node_modules" ] } } } ``` -------------------------------- ### Button Title Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Example of the text content for an action button displayed in settings. This is a simple string value. ```string "Reset settings" ``` -------------------------------- ### Example: Upload Package to Root Cloud (Rootsdk CLI) Source: https://docs.rootapp.com/docs/bot-docs/publish/upload This example shows a complete command to upload a package file to the Root cloud using the `rootsdk upload package` command. It specifies the file path and authentication token. ```bash rootsdk upload package \ --file ./dist/rootapp-1-2-3.pkg \ --auth-token $TOKEN ``` -------------------------------- ### Root Server Start Entry Point Source: https://docs.rootapp.com/docs/bot-docs/get-started/test-your-bot This JavaScript code snippet shows the entry point for your Bot within the DevHost. It calls the start method on the rootServer.lifecycle object, initiating your bot's execution. ```javascript await rootServer.lifecycle.start(); ``` -------------------------------- ### Install Bot Dependencies (npm) Source: https://docs.rootapp.com/docs/bot-docs/get-started/build-your-bot This command installs all necessary packages for your Root Bot project. Open a terminal in your project's root directory and execute this command. It ensures all required libraries are downloaded and ready for use. ```bash npm i ``` -------------------------------- ### String Example: Setting Key Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates a machine-friendly identifier for a setting. This is a required string property used internally by the bot. ```string "maxRaidSize" ``` ```string "notifyOnJoin" ``` -------------------------------- ### String Example: Setting Description Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows an optional explanatory text for a setting. This can be a string providing more details or null if no description is needed. ```string "Set the upper limit for raid participants." ``` ```string null ``` -------------------------------- ### Start Root DevHost Manually Source: https://docs.rootapp.com/docs/bot-docs/get-started/test-your-bot This command manually starts the Root DevHost, the Node execution environment for your Bot. The DevHost reads the launch entry-point from your root-manifest.json file. ```shell rootsdk start devhost ``` -------------------------------- ### Bot Manifest Settings Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Provides an example of the optional 'settings' property in a bot manifest. This object defines configurable global settings for community administrators, including grouped items with keys, titles, and types. ```json { "groups": [ { "key": "general", "title": "General", "items": [ { "key": "notifyOnJoin", "title": "Notify on new join", "description": "Send a message when someone joins the raid.", "required": false, "confirmation": "Update", "checkbox": { "defaultValue": true } } ] } ] } ``` -------------------------------- ### Default Color Value Examples Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows examples of a default color value represented as a hex code string. It can also be null if no default color is specified. ```string "#ff0000" ``` ```string null ``` -------------------------------- ### Bot Manifest Package Property Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows the 'package' property, which contains deployment and startup configuration for the bot. It includes details about the server's launch file, deployment folders, and node modules. ```json { "package": { "server": { "launch": "dist/myBotMain.js", "deploy": [ "dist" ], "node_modules": [ "node_modules" ] } } } ``` -------------------------------- ### Implement Root Bot Start Callback (TypeScript) Source: https://docs.rootapp.com/docs/bot-docs/develop/server-lifecycle Defines the `onStarting` callback function which receives `RootBotStartState` providing community and setting information. This is the place for initialization logic. ```typescript import { RootBotStartState } from "@rootsdk/server-bot"; async function onStarting(state: RootBotStartState) { // Do all your initialization here } ``` -------------------------------- ### String Example: Setting Label Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates a user-facing label for a setting. This is a required string property that will be displayed to the user. ```string "Maximum raid size" ``` ```string "Notify on new join" ``` -------------------------------- ### SQLite Database Operations with Sequelize-typescript Source: https://docs.rootapp.com/docs/bot-docs/develop/persistence/persistence-sqlite This example uses Sequelize-typescript for SQLite database interactions, providing a more object-oriented approach. It defines a User model using decorators and performs database setup and data insertion. Add 'sequelize-typescript' and 'sequelize' as dependencies. ```typescript import { rootServer } from '@rootsdk/server-bot'; import { Sequelize } from "sequelize-typescript"; import { Table, Column, Model, DataType } from "sequelize-typescript"; const sequelize = new Sequelize ({ dialect: "sqlite", storage: rootServer.dataStore.config.sqlite3!.filename, models: [User] }); @Table({ tableName: "users" }) class User extends Model { @Column({ type: DataType.STRING, allowNull: false }) name!: string; @Column({ type: DataType.STRING, allowNull: false }) email!: string; } async function setupDatabase() { await sequelize.sync(); await User.create({ name: "Alice", email: "alice@example.com" }); } ``` -------------------------------- ### Bot Manifest Settings Group Key Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Examples of the 'key' property for a settings group within a bot manifest. This is a machine-friendly identifier for the group, used internally. ```string "general" ``` ```string "notifications" ``` -------------------------------- ### TypeScript Example for Echo Bot Source: https://docs.rootapp.com/docs/bot-docs/tutorials/welcome-bot/generate-build-test-bot This TypeScript code snippet demonstrates the structure of an echo bot using the Root SDK. It imports necessary types, defines an `initialize` method for bot startup, subscribes to message events, and echoes received messages back to the channel. Requires `@rootsdk/server-bot`. ```typescript import { ChannelMessageEvent, BotServer, BotFactory, } from "@rootsdk/server-bot"; async function initialize(server: BotServer) { server.on( ChannelMessageEvent.ChannelMessageCreated, async ({ channel, message }) => { await channel.send(`Echo: ${message.content}`); } ); } BotFactory.create(initialize); ``` -------------------------------- ### String Example: Confirmation Button Text Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Provides the text for the button users click to save a setting. This is a required string property. ```string "Save" ``` ```string "Update" ``` -------------------------------- ### Generate Bot Project with create-root CLI Source: https://docs.rootapp.com/docs/bot-docs/get-started/generate-bot-starter-code This command-line interface (CLI) command uses `npx` to execute the `create-root` tool, generating starter code for a new bot project. The `` parameter specifies the name of the bot and the directory it will be created in. Ensure `npx` is installed via Node.js. ```bash npx create-root --bot ``` ```bash npx create-root --bot MyBot ``` -------------------------------- ### Permissions Object Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference An example of the permissions object structure, defining required permissions for bot functionality. It includes nested objects for channel and community level permissions. ```json { "permissions": { "channel": { "channelFullControl": true, "channelView": true }, "community": { "communityFullControl": false } } } ``` -------------------------------- ### Bot Manifest Settings Group Title Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Examples of the 'title' property for a settings group within a bot manifest. This provides a human-readable title that is displayed above the group of settings. ```string "General Settings" ``` ```string "Notification Preferences" ``` -------------------------------- ### Bot Manifest Server Deploy Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates the 'deploy' property within the 'server' configuration. This is an array of strings, where each string represents a folder to be included in the bot's deployment package. ```json [ "dist" ] ``` -------------------------------- ### Package Project Command Usage Source: https://docs.rootapp.com/docs/bot-docs/publish/package This section demonstrates the basic usage of the `rootsdk build package` command. It outlines the command structure and provides examples of how to package a project with default settings or with custom options for output file and project directory. ```bash rootsdk build package [options] ``` ```bash rootsdk build package ``` ```bash rootsdk build package --output-file ./dist ``` ```bash rootsdk build package --output-file ./dist/custom-name.pkg ``` ```bash rootsdk build package --project-folder ../my-project --output-file ./dist/pkg ``` -------------------------------- ### Number Example: Numeric Input Step Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows the increment step for a numeric input field. This property is a number or null. ```number 1 ``` ```number null ``` -------------------------------- ### Basic Manifest Structure (JSON) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-overview A minimal example of a root-manifest.json file. This JSON structure is the foundation for defining bot integrations within the Root platform, specifying essential configuration details. ```json { "Bot": "TBD" } ``` -------------------------------- ### Bot Manifest Server Node Modules Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates the 'node_modules' property within the 'server' configuration. This array of strings lists the node_modules folders that must be deployed with the bot. ```json [ "node_modules" ] ``` -------------------------------- ### Number Example: Numeric Input Min/Max Value Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates optional minimum and maximum values for a numeric input field. These properties are numbers or null. ```number 1 ``` ```number 100 ``` ```number null ``` -------------------------------- ### String Example: Text Input Default Value Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows the default text pre-filled in a free-form text input field. This property is optional and can be null. ```string "Enter a title..." ``` ```string null ``` -------------------------------- ### Array Example: Pre-selected User IDs Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates an array of strings representing pre-selected user IDs for member selection. This property is optional. ```json [ "user-123", "user-456" ] ``` -------------------------------- ### Install Rootsdk Dev Tools (package.json) Source: https://docs.rootapp.com/docs/bot-docs/publish/upload This snippet shows how to add the Rootsdk development tools to your project's devDependencies in `package.json`. Ensure this is included for using Rootsdk commands. ```json { "devDependencies": { "@rootsdk/dev-tools": "*" } } ``` -------------------------------- ### Example TypeScript Bot Logic Source: https://docs.rootapp.com/docs/bot-docs/tutorials/announce-bot/generate-build-test-bot Illustrates the basic structure of a Root Bot's message handling logic in TypeScript. It subscribes to message creation events, retrieves the message content, and echoes it back to the same channel. ```typescript import { ChannelMessageEvent, BotClient, } from "@rootsdk/server-bot"; export async function initialize(client: BotClient) { client.on(ChannelMessageEvent.ChannelMessageCreated, async (event) => { const message = event.data.message; if (message.content) { await client.message.send(message.channelId, message.content); } }); } ``` -------------------------------- ### Select Channel IDs (Array of Strings) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This example illustrates how to specify an array of channel IDs for selection. Each string in the array corresponds to a unique channel identifier. ```json [ "chan-1", "chan-2" ] ``` -------------------------------- ### String Example: Text Input Regex Validation Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates a regular expression used to validate free-form text input. This property is optional and can be null. ```string "^[a-z0-9\\-]+$" ``` ```string null ``` -------------------------------- ### Running Root Bot Locally (npm command) Source: https://docs.rootapp.com/docs/bot-docs/develop/bot-project-overview The command to execute to start the Root Bot in a local development environment using the configured devhost. This command utilizes the scripts defined in package.json. ```bash npm run bot ``` -------------------------------- ### Build Root Bot Project (npm) Source: https://docs.rootapp.com/docs/bot-docs/get-started/build-your-bot This command compiles your Bot's source code, typically located in the `src` folder, into the `dist` folder. After installation, run this command in your project's terminal to prepare your Bot for local execution. It transforms your source code into a runnable format. ```bash npm run build ``` -------------------------------- ### Boolean Example: Required Setting Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates the 'required' property, indicating whether a user must provide a value for the setting. This is a mandatory boolean. ```boolean true ``` ```boolean false ``` -------------------------------- ### Pre-select Community Role IDs for Role and Member Selector (Array of Strings) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This example demonstrates how to provide an array of strings for pre-selected community role IDs when using the 'roleAndMember' selector. ```json [ "role-x" ] ``` -------------------------------- ### Install Root Developer Tools Source: https://docs.rootapp.com/docs/bot-docs/publish/package This snippet shows how to include the Root Developer SDK tools in your project by adding `@rootsdk/dev-tools` as a development dependency in your `package.json` file. This is typically done using a package manager like npm or yarn. ```json { "devDependencies": { "@rootsdk/dev-tools": "*" } } ``` -------------------------------- ### Default Time Value Examples Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates the representation of a default time value in HH:MM:SS format. It can be a string or null if no default is set. ```string "09:30:00" ``` ```string null ``` -------------------------------- ### Define Custom Select Options (Array of Objects) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This example defines a list of custom options for selection. Each option is an object with a required 'label' (user-facing text) and a required 'value' (machine value). ```json [ { "label": "Low", "value": "low" }, { "label": "Medium", "value": "medium" }, { "label": "High", "value": "high" } ] ``` -------------------------------- ### Bot Manifest Version Property Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates the 'version' property, which specifies the semantic version string (e.g., MAJOR.MINOR.PATCH) for the bot package. This version must be unique for each release. ```json { "version": "1.0.0" } ``` -------------------------------- ### Select Channel Group IDs (Array of Strings) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This example shows how to specify an array of channel group IDs for selection. Each string in the array represents a unique channel group identifier. ```json [ "grp-1" ] ``` -------------------------------- ### Pre-select Community Role IDs (Array of Strings) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This example shows how to define an array of strings representing pre-selected community role IDs. Each string in the array corresponds to a specific role identifier. ```json [ "role-abc", "role-def" ] ``` -------------------------------- ### Set, Get, and Update User XP using KeyValueStore in JavaScript Source: https://docs.rootapp.com/docs/bot-docs/develop/persistence/persistence-key-value-store This snippet demonstrates how to use the `KeyValueStore` in the Root Developer SDK to manage user experience points. It shows how to set an initial XP value, retrieve the current XP, and update it by adding more points. The `update` method allows for a default value if the key does not exist and uses a callback function for the update logic. ```javascript // The KeyValueStore object is in rootServer.dataStore.appData import { rootServer } from "@rootsdk/server-bot"; const userId: string = "..."; // You'd retrieve the userId from the incoming community message // Set user XP to 100 await rootServer.dataStore.appData.set( key: userId, value: 100, ); // Get user XP const xp: number = await rootServer.dataStore.appData.get(userId) ?? 0; // Add 50 XP const updatedXp: number = await rootServer.dataStore.appData.update( userId, (currentXp) => currentXp + 50, // Update function 0 // Default XP to pass to update function if this userId isn't set yet ); ``` -------------------------------- ### Echo Every Community Message with Root SDK Source: https://docs.rootapp.com/docs/bot-docs/develop/community-api This example demonstrates how to echo back every message posted in a community channel using the Root SDK. It subscribes to the ChannelMessageCreated event and uses the channelMessages.create method to send the message content back to the originating channel. Requires the '@rootsdk/server-bot' package. ```typescript import { rootServer, ChannelMessageEvent, ChannelMessageCreatedEvent, ChannelMessageCreateRequest, } from "@rootsdk/server-bot"; // At startup, subscribe to be notified when members post messages in any community channel (async () => { rootServer.community.channelMessages.on(ChannelMessageEvent.ChannelMessageCreated, onMessage); await rootServer.lifecycle.start(initialize); })(); async function onMessage(evt: ChannelMessageCreatedEvent): Promise { // Retrieve the incoming message from the event object const reply: string = evt.messageContent; // Send that same message back to the channel where it was posted const request: ChannelMessageCreateRequest = { channelId: evt.channelId, content: reply }; await rootServer.community.channelMessages.create(request); } ``` -------------------------------- ### SQLite Database Operations with Knex Source: https://docs.rootapp.com/docs/bot-docs/develop/persistence/persistence-sqlite This example shows how to use the Knex query builder for SQLite database operations. It includes creating a table and inserting data programmatically. You need to add 'knex' as a dependency in your package.json. ```typescript import { rootServer } from '@rootsdk/server-bot'; import Knex from "knex"; const knex = Knex( { client: "sqlite3", connection: { filename: rootServer.dataStore.config.sqlite3!.filename }, useNullAsDefault: true }); await knex.schema.createTable("users", (table) => { table.increments("id").primary(); table.string("name"); table.string("email"); }); await knex("users").insert({ name: "bob", email: "bob@example.com" }); ``` -------------------------------- ### Announce New Member Joined Community with Root SDK Source: https://docs.rootapp.com/docs/bot-docs/develop/community-api This example shows how to post a message to a community's system channel when a new member joins. It listens for the CommunityJoined event, retrieves the new member's nickname, and then uses channelMessages.create to post the announcement. Requires the '@rootsdk/server-bot' package and a configured default channel. ```typescript import { rootServer, Community, CommunityMember, CommunityEvent, CommunityJoinedEvent, CommunityMemberGetRequest, ChannelMessageCreateRequest, } from "@rootsdk/server-bot"; // At startup, subscribe to be notified when new members join the community (async () => { rootServer.community.communities.on(CommunityEvent.CommunityJoined, onJoined); await rootServer.lifecycle.start(); })(); async function onJoined(evt: CommunityJoinedEvent): Promise { // Retrieve information about the current community const community: Community = await rootServer.community.communities.get(); // Verify the community has set a system-message channel (called default channel in code) if (!community.defaultChannelId) return; // Get the nickname of the new member const memberRequest: CommunityMemberGetRequest = { userId: evt.userId }; const member: CommunityMember = await rootServer.community.communityMembers.get(memberRequest); const nickname: string = member.nickname; // Write a message to the community's system-message channel const messageRequest: ChannelMessageCreateRequest = { channelId: community.defaultChannelId, content: nickname + " joined"}; await rootServer.community.channelMessages.create(messageRequest); } ``` -------------------------------- ### Generate Root Bot Starter Code with npx Source: https://docs.rootapp.com/docs/bot-docs/tutorials/announce-bot/generate-build-test-bot Generates starter code for a new Root Bot project using the `create-root` command-line utility. This command initializes a new project with the necessary structure and dependencies for a Root Bot. ```bash npx create-root@latest --bot ``` -------------------------------- ### Declare Server Entry Point in Manifest Source: https://docs.rootapp.com/docs/bot-docs/develop/server-lifecycle This snippet shows how to define the server's entry point file in the 'launch' section of the root-manifest.json file. This file is typically the compiled output of your main server code. ```json { "name": "MyName", "description": "My description", "version": "1.0.0", "launch": { "server": "server/dist/main.js" } } ``` -------------------------------- ### Send Message to Multiple Channels | TypeScript Source: https://docs.rootapp.com/docs/bot-docs/tutorials/announce-bot/send-to-all-channels Sends a given reply content to a list of specified channel GUIDs. It iterates through each channel GUID and uses the rootServer.community.channelMessages.create method to send the message. Dependencies include ChannelGuid and ChannelMessageCreateRequest types. ```typescript async function sendMessage(reply: string, channels: ChannelGuid[]): Promise { for (const channelGuid of channels) { const request: ChannelMessageCreateRequest = { channelId: channelGuid, content: reply }; await rootServer.community.channelMessages.create(request); } } ``` -------------------------------- ### Build Root Bot Project with npm Source: https://docs.rootapp.com/docs/bot-docs/tutorials/announce-bot/generate-build-test-bot Compiles the TypeScript code into JavaScript, preparing the bot for execution. This command uses the `build` script defined in the `package.json` file. ```bash npm run build ``` -------------------------------- ### Upload Package Command (Rootsdk CLI) Source: https://docs.rootapp.com/docs/bot-docs/publish/upload Demonstrates the basic usage of the `rootsdk upload package` command for deploying code to the Root cloud. It requires a package file path and an authentication token. ```bash rootsdk upload package [options] ``` -------------------------------- ### Boolean Example: Member Multi-Select Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Shows whether multiple members can be selected in a member selection input. This is an optional boolean property. ```boolean false ``` ```boolean true ``` -------------------------------- ### Register Root Bot Lifecycle Callbacks (TypeScript) Source: https://docs.rootapp.com/docs/bot-docs/develop/server-lifecycle Demonstrates various ways to call `rootServer.lifecycle.start` with different combinations of `onStarting`, `onStopping`, and `onStopped` callbacks. You can pass `undefined` to skip specific callbacks. ```typescript import { rootServer, RootBotStartState } from "@rootsdk/server-bot"; async function onStarting(state: RootBotStartState) { // Do all your initialization here } async function onStopping() { // Do your main cleanup here } async function onStopped() { // Do any last-second cleanup here } (async () => { // Various ways to call start await rootServer.lifecycle.start(); // No callbacks await rootServer.lifecycle.start(onStarting); // Starting callback only await rootServer.lifecycle.start(onStarting, undefined, onStopped); // Pass undefined to skip unneeded callbacks await rootServer.lifecycle.start(onStarting, onStopping, onStopped); // All })(); ``` -------------------------------- ### Number Example: Numeric Input Default Value Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Illustrates the default numeric value for a numeric input field. This property is a number or null. ```number 10 ``` ```number null ``` -------------------------------- ### Date Object Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Represents a raw date object in YYYY-MM-DD format. This is a nested object used within a larger date field structure. ```json { "$date": "2025-08-05" } ``` -------------------------------- ### Configure Development Token (.env) Source: https://docs.rootapp.com/docs/bot-docs/get-started/build-your-bot This snippet shows how to add your `DEV_TOKEN` to the `.env` file in your Bot's project directory. Ensure you replace the sample token with your actual development token. This is crucial for authenticating your bot during local development. ```env DEV_TOKEN=ACROZj4Ilajlkgjoilkjdljfb5l2jln426k42548fdlj4359204undlajf_lkaejrln3904280294FLWalPd35aoier82m_lkad4lkjas0kj-aeheccewqioclbaljer34akjwqpz_-lk-kO52jQjlaljbjlk5299elk2aklbwpcast67lka0as2lgxlmqJSO98absLa34s90gask2ac ``` -------------------------------- ### Bot Manifest ID Property Example Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Demonstrates the 'id' property within a bot manifest. This unique identifier is obtained from the Root Developer Portal and is a required field. ```json { "id": "ACj4U-eThgmjXUOBAjk_jw" } ``` -------------------------------- ### Timestamp Object Example (ISO 8601) Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference Represents a timestamp in ISO 8601 format. This object is used to store date and time information, typically for logging or event tracking. ```json { "$date": "2025-08-05T00:00:00Z" } ``` -------------------------------- ### Website Settings API Source: https://docs.rootapp.com/docs/bot-docs/configure/manifest-reference This section details the various settings that can be configured for the website, including time, date, color, and button properties. ```APIDOC ## Website Settings Configuration ### Description This endpoint allows for the configuration of various settings for the website, including time, date, and color preferences. ### Method PUT ### Endpoint /websites/rootapp_bot-docs ### Parameters #### Request Body - **time** (object or null) - Optional - Raw timestamp object (ISO 8601). - **defaultValue** (string or null) - Optional - Default time value (HH:MM:SS). - **date** (object or null) - Optional - Date field object (YYYY-MM-DD). - **date** (object or null) - Optional - Raw date object. - **color** (object or null) - Optional - Color picker field (hex code). - **defaultValue** (string or null) - Optional - Default color value. - **button** (object or null) - Optional - Action button displayed in settings. - **title** (string) - Optional - Text shown on the button. ### Request Example ```json { "time": {"$date": "2025-08-05T00:00:00Z"}, "defaultValue": "09:30:00", "date": {"$date": "2025-08-05"}, "color": {"defaultValue": "#ff0000"}, "button": {"title": "Reset settings"} } ``` ### Response #### Success Response (200) - **message** (string) - Indicates successful configuration update. #### Response Example ```json { "message": "Website settings updated successfully." } ``` ```