{"id":271027,"date":"2025-07-14T06:11:03","date_gmt":"2025-07-14T06:11:03","guid":{"rendered":"https:\/\/www.revechat.com\/?post_type=help-center&#038;p=271027"},"modified":"2026-04-29T07:19:54","modified_gmt":"2026-04-29T07:19:54","slug":"scripts","status":"publish","type":"help-center","link":"https:\/\/www.revechat.com\/help-center\/scripts\/","title":{"rendered":"Scripts"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Scripts enhance your bot\u2019s capabilities by enabling custom logic and actions beyond standard features. Learn how to use Scripts in REVE Chat, it lets you easily add JavaScript code in chatbot!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Why do you need Scripts?<\/mark><\/h2>\n\n\n\n<p>With Scripts, your bot can perform tasks like formatting dates for readability, extracting specific data from user input, breaking down complex queries responses, modify and update attribute values and much more.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tailored Logic Integration<\/strong>: Scripts allow you to add customized logic to meet specific needs not covered by default bot features.<\/li>\n\n\n\n<li><strong>More Flexibility<\/strong>: Custom Scripts let you handle complex operations, and connect with external systems.<\/li>\n\n\n\n<li><strong>Smooth Integration<\/strong>: Scripts make it easy to connect with third-party APIs, databases, and external services, expanding the bot\u2019s capabilities.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">How to use Scripts in Chatbot<\/mark><\/h2>\n\n\n\n<p>To create a function, follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to Settings &gt; General Settings &gt; Scripts &gt; Create Script.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-dominant-color=\"f5f7fb\" data-has-transparency=\"false\" style=\"--dominant-color: #f5f7fb;\" decoding=\"async\" width=\"1024\" height=\"509\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1-1024x509.png\" alt=\"\" class=\"not-transparent wp-image-271029\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1-1024x509.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1-300x149.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1-768x381.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1-1536x763.png 1536w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script1.png 1919w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Provide a specific name to your script and click on the Create button.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-dominant-color=\"dadde1\" data-has-transparency=\"false\" style=\"--dominant-color: #dadde1;\" decoding=\"async\" width=\"834\" height=\"413\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script2.png\" alt=\"\" class=\"not-transparent wp-image-271031\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script2.png 834w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script2-300x149.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script2-768x380.png 768w\" sizes=\"(max-width: 834px) 100vw, 834px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Add your script in the newly created script page<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-dominant-color=\"aeafb0\" data-has-transparency=\"false\" style=\"--dominant-color: #aeafb0;\" decoding=\"async\" width=\"1024\" height=\"621\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script3-1024x621.png\" alt=\"\" class=\"not-transparent wp-image-271032\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script3-1024x621.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script3-300x182.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script3-768x466.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script3.png 1202w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the chatbot and use Script action within the flow<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-dominant-color=\"eceff4\" data-has-transparency=\"false\" style=\"--dominant-color: #eceff4;\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4-1024x504.png\" alt=\"\" class=\"not-transparent wp-image-271034\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4-1024x504.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4-300x148.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4-768x378.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4-1536x756.png 1536w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script4.png 1919w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Add the script action in chatbot<\/figcaption><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-dominant-color=\"f0f2f5\" data-has-transparency=\"false\" style=\"--dominant-color: #f0f2f5;\" decoding=\"async\" width=\"1024\" height=\"500\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script5-1024x500.png\" alt=\"\" class=\"not-transparent wp-image-271036\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script5-1024x500.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script5-300x147.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script5-768x375.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script5.png 1390w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Test the return value of the script you stored in an attribute<\/figcaption><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Creating Scripts for your bot\u200b<\/mark><\/h2>\n\n\n\n<p>You can create a custom script using JavaScript to implement specific functionality for your bot. Use the following code template and simply replace &#8216;<code>Write your code here<\/code>&#8216; with the actions or logic you want to execute:<\/p>\n\n\n\n<p>You can define a custom function using JavaScript. Here is a sample code snippet. Just replace the placeholder &#8216;Your logic goes here&#8217; with the specific functionality you wish to implement.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">return new Promise(resolve =&gt; {  \n      \/\/ Write your code here\n      resolve();\n  }); <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Script argument to access user data<\/mark><\/h2>\n\n\n\n<p>In programming, arguments act as inputs that let the bot access specific information or execute defined actions within your code, creating more targeted and dynamic responses.<\/p>\n\n\n\n<p>To access user-specific information, use: <code>data.attribute_name<\/code> , where <code>&lt;attribute_name&gt;<\/code> is a variable. Here, you can use any system attribute of REVE Chat or custom attributes you have created to use the variable data directly within the script.<\/p>\n\n\n\n<p>Get the list of system attributes<\/p>\n\n\n\n<p>Learn more about custom attributes<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Save values in attribute<\/mark><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Single Attribute Storage<\/li>\n<\/ul>\n\n\n\n<p>In some cases, you might want to save all returned data in a single attribute. For example, you might want to store a single piece of information like user_status or a complete return value as a single entry. This is useful for smaller or consolidated data needs.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-dominant-color=\"bdc3c9\" data-has-transparency=\"false\" decoding=\"async\" width=\"537\" height=\"677\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script6.png\" alt=\"\" class=\"not-transparent wp-image-271041\" style=\"--dominant-color: #bdc3c9; width:261px;height:auto\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script6.png 537w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script6-238x300.png 238w\" sizes=\"(max-width: 537px) 100vw, 537px\" \/><\/figure><\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Multiple Attribute Updates (Example Code Below)<\/li>\n<\/ul>\n\n\n\n<p>If you need to manage several pieces of user data, you can use a custom JavaScript script to assign values to multiple attributes at once. This method is particularly useful when handling several pieces of data, such as user contact details, preferences, or responses, in one go.<\/p>\n\n\n\n<p>Here\u2019s an example of how to update multiple attributes:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">\/\/ You can set multiple attribute using our script function. A sample script function is given below.\nreturn new Promise(resolve =&gt; {  \n      \/\/set variables\n      let name = data.name;\n      let phone = data.phone;\n\n\/\/return below object with type value &quot;set_variables&quot; to update multiple attributes at a time\n      let returnObj = {\n            type: &quot;set_variables&quot;,\n            variables: {\n                  name: name,\n                  phone: phone\n            }\n      };\n      resolve(returnObj);\n});<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Publishing a Script<\/mark><\/h2>\n\n\n\n<p>To publish a script, you need to test the script if it is working fine or not.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Simple Scripts (Returning Only Value or JSON): Click the Test Now button. If everything works correctly, you can then publish the script.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"bebdbb\" data-has-transparency=\"false\" style=\"--dominant-color: #bebdbb;\" decoding=\"async\" width=\"1024\" height=\"727\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script7-1024x727.png\" alt=\"\" class=\"not-transparent wp-image-271044\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script7-1024x727.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script7-300x213.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script7-768x545.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script7.png 1236w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scripts with Dynamic Values from Attributes:\n<ul class=\"wp-block-list\">\n<li>Provide sample values for any attributes referenced in the script. You can use text, numeric, or Json response as your sample variable depending on the type of your script.<\/li>\n\n\n\n<li>Click Test Now to verify the script before publishing<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"c8cbcd\" data-has-transparency=\"false\" style=\"--dominant-color: #c8cbcd;\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8-1024x559.png\" alt=\"\" class=\"not-transparent wp-image-271046\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8-1024x559.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8-300x164.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8-768x420.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8-1536x839.png 1536w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script8.png 1642w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>One your script is ready and works perfectly, live the script to use in chatbot.<\/li>\n<\/ul>\n\n\n\n<p>Note: If you use <code>data.attribute_name<\/code> to reference attributes, you must define sample values to avoid undefined values during testing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"b8c0c7\" data-has-transparency=\"false\" style=\"--dominant-color: #b8c0c7;\" decoding=\"async\" width=\"1024\" height=\"615\" src=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script10-1024x615.png\" alt=\"\" class=\"not-transparent wp-image-271047\" srcset=\"https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script10-1024x615.png 1024w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script10-300x180.png 300w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script10-768x461.png 768w, https:\/\/www.revechat.com\/wp-content\/uploads\/2025\/07\/Script10.png 1086w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">How Scripts work<\/mark><\/h2>\n\n\n\n<p>This section explains how scripts operate within your bot, starting with simple examples and progressing to more complex scenarios to help you build your skills step-by-step.<\/p>\n\n\n\n<p>The following code examples include some fundamental JavaScript concepts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>let<\/code>: Declares a variable to store data.<\/li>\n\n\n\n<li><code>resolve<\/code><strong>:<\/strong> Completes a promise and returns the function&#8217;s output.<\/li>\n\n\n\n<li><code>if\/else<\/code>: Allows the bot to make decisions based on conditions.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Display user ID<\/mark><\/h3>\n\n\n\n<p>The following example demonstrates how to display the current user ID:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">return new Promise(resolve =&gt; {\n    let internal_user_id = data.internal_user_id;  \/\/ Retrieve the user ID from the data object \n    resolve(`The current user ID is ${internal_user_id}`); \/\/ Return a message with the user ID \n});<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Explanation<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Access User ID<\/strong>: The internal_user_id variable is set to the user ID by accessing data.internal_user_id.<\/li>\n\n\n\n<li><strong>Display Message<\/strong>: The function returns a message containing the user ID, which will be shown to the user.<\/li>\n<\/ul>\n\n\n\n<p><strong>Output<\/strong>: The current user ID is [internal_user_id]<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Process current data and time<\/mark><\/h3>\n\n\n\n<p>The following code snippet captures the current date and time in the Asia\/Kolkata time zone, formats it, and logs the results. The function then returns the current date.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">return new Promise(resolve =&gt; {\n    let currentdate = new Date();  \/\/ Captures the system\u2019s current date and time\n    let currentTime = new Date().toLocaleTimeString(&#039;en-IN&#039;, { timeZone: &#039;Asia\/Kolkata&#039; });\n   \n    \n    resolve(currentdate);              \/\/ Returns the current date\n});<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Explanation<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Retrieve Current Date<\/strong>: currentdate is initialized with the system&#8217;s current date and time.<\/li>\n\n\n\n<li><strong>Set and Format Current Time<\/strong>:\n<ul class=\"wp-block-list\">\n<li><code>let currentTime<\/code>: Declares a variable for the formatted time.<\/li>\n\n\n\n<li><code>new Date()<\/code>: Creates a Date object for the current date and time.<\/li>\n\n\n\n<li><code>.toLocaleTimeString(&#039;en-IN&#039;, { timeZone: &#039;Asia\/Kolkata&#039; })<\/code>: Formats the time for the India (en-IN) locale in the Asia\/Kolkata time zone, displaying it in Indian Standard Time (IST).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Return Date<\/strong>: The function resolves with the current date, completing the operation.<\/li>\n<\/ul>\n\n\n\n<p><strong>Output<\/strong>: This script logs the current date and formatted time (Asia\/Kolkata time zone) to the console and returns the current date.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">Custom date range formatter and save value<\/mark><\/h3>\n\n\n\n<p>This script calculates and formats a date range, providing the start of the current month and the current date and time in a custom &#8220;YYYYMMDDHHMMSS&#8221; format.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">return new Promise(resolve =&gt; {\n    function getDatesInCustomFormat() {\n        \/\/ Get the current date\n        const now = new Date();\n        \n        \/\/ Get the timezone offset in milliseconds\n        const timezoneOffset = now.getTimezoneOffset() * 60000;\n\n        \/\/ Calculate the start date (first day of the current month) in local timezone\n        const startDate = new Date(now.getFullYear(), now.getMonth(), 1);\n        const startDateLocal = new Date(startDate.getTime() - timezoneOffset);\n\n        \/\/ Calculate the end date (current date and time) in local timezone\n        const endDate = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59);\n        const endDateLocal = new Date(endDate.getTime() - timezoneOffset);\n\n        \/\/ Helper function to format date as YYYYMMDDHHMMSS\n        function formatDate(date) {\n            const year = date.getFullYear();\n            const month = String(date.getMonth() + 1).padStart(2, &#039;0&#039;);\n            const day = String(date.getDate()).padStart(2, &#039;0&#039;);\n            const hours = String(date.getHours()).padStart(2, &#039;0&#039;);\n            const minutes = String(date.getMinutes()).padStart(2, &#039;0&#039;);\n            const seconds = String(date.getSeconds()).padStart(2, &#039;0&#039;);\n\n            return `${year}${month}${day}${hours}${minutes}${seconds}`;\n        }\n\n        \/\/ Return the result as a JSON object with &#039;from&#039; and &#039;to&#039; keys\n        return {\n            start_time: formatDate(startDateLocal),\n            current_time: formatDate(endDateLocal)\n        };\n    }\n\n    \/\/ Resolve the promise with the result of the function\n    resolve(getDatesInCustomFormat());\n});\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Explanation<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Get Current Date and Time (now)<\/strong>: The <code>now<\/code> variable captures the current date and time for calculating both the start and end dates.<\/li>\n\n\n\n<li><strong>Adjust for Timezone Offset<\/strong>: <code>timezoneOffset<\/code> converts the timezone offset from minutes to milliseconds. This ensures that calculations adjust for the local time zone.<\/li>\n\n\n\n<li><strong>Calculate Start and End Dates<\/strong>:\n<ul class=\"wp-block-list\">\n<li><strong>Start Date<\/strong>: <code>startDate<\/code> is set to the first day of the current month at midnight. Then, <code>startDateLocal<\/code> is created by adjusting for the timezone offset.<\/li>\n\n\n\n<li><strong>End Date<\/strong>: <code>endDate<\/code> is set to the current date at 23:59:59 (end of the day). <code>endDateLocal<\/code> adjusts this date to the local timezone.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Format Dates (Helper Function)<\/strong>: The <code>formatDate<\/code> function converts a Date object into the &#8220;YYYYMMDDHHMMSS&#8221; format:\n<ul class=\"wp-block-list\">\n<li><strong>Formatting Components<\/strong>: The <code>year<\/code>, <code>month<\/code>, <code>day<\/code>, <code>hours<\/code>, <code>minutes<\/code>, and <code>second<\/code>s are extracted and padded to two digits where needed.<\/li>\n\n\n\n<li><strong>Return Formatted String<\/strong>: These values are combined into a formatted string (e.g., &#8220;20241027111559&#8221;).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Return JSON Object<\/strong>: The function returns a JSON object with:\n<ul class=\"wp-block-list\">\n<li><strong>start_time<\/strong>: The formatted start date for the month.<\/li>\n\n\n\n<li><strong>current_time<\/strong>: The formatted current date and time.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Resolve the Promise<\/strong>: The promise is resolved with the formatted JSON object, making this data available for further use.<\/li>\n<\/ul>\n\n\n\n<p><strong>Output<\/strong>: This script returns a JSON object with the start time of the month and the current date and time in &#8220;YYYYMMDDHHMMSS&#8221; format, adjusted for local timezone.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">{\n  &quot;start_time&quot;: &quot;20241001060000&quot;,\n  &quot;current_time&quot;: &quot;20241028055959&quot;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0);color:#181d27\" class=\"has-inline-color\">What Next?<\/mark><\/h2>\n\n\n\n<p>Create your own function and use it by adding an API action in the chatbot flow. Lean how API works.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scripts enhance your bot\u2019s capabilities by enabling custom logic and actions beyond standard features. Learn how to use Scripts in REVE Chat, it lets you easily add JavaScript code in chatbot! Why do you need Scripts? With Scripts, your bot can perform tasks like formatting dates for readability, extracting specific data from user input, breaking [&hellip;]<\/p>\n","protected":false},"author":36,"featured_media":0,"menu_order":102,"template":"","meta":{"_acf_changed":false,"footnotes":""},"help_center_type":[1812],"class_list":["post-271027","help-center","type-help-center","status-publish","hentry","help_center_type-general-settings"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center"}],"about":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/types\/help-center"}],"author":[{"embeddable":true,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/users\/36"}],"version-history":[{"count":10,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271027\/revisions"}],"predecessor-version":[{"id":302994,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help-center\/271027\/revisions\/302994"}],"wp:attachment":[{"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/media?parent=271027"}],"wp:term":[{"taxonomy":"help_center_type","embeddable":true,"href":"https:\/\/www.revechat.com\/wp-json\/wp\/v2\/help_center_type?post=271027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}