### Install and Setup LUIS.ai Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-luis.ai/README.md Commands to download the LUIS.ai example project and install dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-luis.ai cd with-luis.ai npm install ``` -------------------------------- ### Install and Run Memory Session Example Source: https://github.com/yoctol/bottender/blob/master/examples/session-memory/README.md Follow these steps to download, install, and run the memory session example for Bottender. This involves cloning the repository, navigating to the example directory, installing dependencies, and starting the development server in console mode. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-memory cd session-memory npm install npm run dev -- --console ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/line-liff-v1/README.md Commands to download the example project and install necessary dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/line-liff-v1 cd line-liff-v1 ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/line-hello-world/README.md Use this command to download the example code and install its dependencies. Ensure you have npm installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/line-hello-world cd line-hello-world ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-handover/README.md Use this command to download the example code and install its dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-handover cd messenger-handover npm install ``` -------------------------------- ### Install and Run MongoDB Session Example Source: https://github.com/yoctol/bottender/blob/master/examples/session-mongo/README.md Commands to download, install dependencies, and start the MongoDB session example project. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-mongo cd session-mongo npm install npm run dev -- --console ``` -------------------------------- ### Install and Run Bottender Session File Example Source: https://github.com/yoctol/bottender/blob/master/examples/session-file/README.md Use these commands to download, install, and run the session file example for Bottender. This setup allows for local storage of session data. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-file cd session-file npm install npm run dev -- --console ``` -------------------------------- ### Install and Run Bottender State Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-state/README.md Commands to download, install dependencies, and start the state management example in console mode. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-state cd with-state npm install npm run dev -- --console ``` -------------------------------- ### Install and Run Todo Example Source: https://github.com/yoctol/bottender/blob/master/examples/todos/README.md Commands to download, install, and run the todo example locally. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/todos cd todos npm install npm run dev -- --console ``` -------------------------------- ### Install and Run Echo Bot Source: https://github.com/yoctol/bottender/blob/master/examples/echo-bot/README.md Follow these steps to download, install, and run the Echo Bot example. This involves cloning the repository, navigating to the example directory, installing dependencies, and starting the bot in console mode. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/echo-bot cd echo-bot npm install npm run dev -- --console ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-modal-form/README.md Download the example code and install its dependencies. Ensure you have Node.js and npm installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-modal-form cd slack-modal-form npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-one-time-notification/README.md Use curl to download the example code and then navigate into the example directory. Ensure you have the necessary dependencies installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-one-time-notification cd messenger-one-time-notification ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-account-linking/README.md Commands to download the example project and navigate to the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-account-linking cd messenger-account-linking ``` -------------------------------- ### Download and Install Multiple Channels Example Source: https://github.com/yoctol/bottender/blob/master/examples/multiple-channels/README.md Commands to download the example project and install necessary dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/multiple-channels cd multiple-channels ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-multi-pages/README.md Commands to download the multi-pages example and navigate to the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-multi-pages cd messenger-multi-pages ``` -------------------------------- ### Install QnA Maker Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-qna-maker/README.md Downloads the QnA Maker example project from the Bottender repository and installs dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-qna-maker cd with-qna-maker npm install ``` -------------------------------- ### Download and Setup Telegram Inline Query Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-inline-query/README.md Use this command to download the example code and navigate to the project directory. Ensure you have Node.js and npm installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-inline-query cd telegram-inline-query ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-home-tab/README.md Use this command to download the example code and navigate into the project directory. Ensure you have `curl` and `tar` installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-home-tab cd slack-home-tab ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-game/README.md Commands to download the telegram-game example project and install its dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-game cd telegram-game ``` ```sh npm install ``` -------------------------------- ### Install and Run Session Redis Example Source: https://github.com/yoctol/bottender/blob/master/examples/session-redis/README.md Follow these commands to download, install, and run the session-redis example for Bottender. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-redis cd session-redis npm install npm run dev -- --console ``` -------------------------------- ### Download and Install Slack Ephemeral Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-post-ephemeral/README.md Commands to download the example project and install necessary dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-post-ephemeral cd slack-post-ephemeral ``` ```sh npm install ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-inline-keyboard/README.md Use curl to download the example code and then navigate into the directory. Install project dependencies using npm. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-inline-keyboard cd telegram-inline-keyboard ``` ```sh npm install ``` -------------------------------- ### Install and Run Browser-Only Bot Source: https://github.com/yoctol/bottender/blob/master/examples/browser-only/README.md Follow these commands to download the example, install dependencies, and start the browser-only bot. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/browser-only cd browser-only npm install npm start ``` -------------------------------- ### Download and Install Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-gcp-cloud-function/README.md Commands to download the GCP Cloud Function example and install necessary dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-gcp-cloud-function cd with-gcp-cloud-function ``` ```sh npm install ``` -------------------------------- ### Download and Navigate Example Source: https://github.com/yoctol/bottender/blob/master/examples/whatsapp-hello-world/README.md Use curl to download the example and then navigate into the directory. This sets up the project locally. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/whatsapp-hello-world cd whatsapp-hello-world ``` -------------------------------- ### Install and Run Dialogflow Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-dialogflow/README.md Use these commands to download, install dependencies, and run the Dialogflow example bot. Ensure your .env file is configured with GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_APPLICATION_PROJECT_ID. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-dialogflow cd with-dialogflow npm install ``` ```sh npm run dev -- --console ``` -------------------------------- ### Install Bottender Rasa Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-rasa/README.md Downloads the Rasa example project from the Bottender repository and installs dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-rasa cd with-rasa npm install ``` -------------------------------- ### Download and Install Slack Interactive Message Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-interactive-message/README.md Commands to download the example project and navigate to the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-interactive-message cd slack-interactive-message ``` -------------------------------- ### Download and Install Messenger Persona Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-persona/README.md Commands to clone the example project and install necessary dependencies. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-persona cd messenger-persona ``` ```sh npm install ``` -------------------------------- ### Get Started Button API Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-messenger-client.md Methods to manage the Get Started button configuration. ```APIDOC ## getGetStarted() ### Description Retrieves the current value of the get started button. ### Response - **payload** (String) - The payload sent back to the webhook. ## setGetStarted(payload) ### Description Sets the values of the get started button. ### Parameters #### Request Body - **payload** (String) - Required - Payload sent back to your webhook in a messaging_postbacks event. ## deleteGetStarted() ### Description Deletes the get started button. ``` -------------------------------- ### Download and Navigate Example Source: https://github.com/yoctol/bottender/blob/master/examples/viber-hello-world/README.md Use curl to download the example and then navigate into the project directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/viber-hello-world cd viber-hello-world ``` -------------------------------- ### Install Messenger Batch Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-batch/README.md Download and navigate to the messenger-batch example directory. Install project dependencies using npm. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-batch cd messenger-batch npm install ``` -------------------------------- ### Download and Install LINE LIFF V2 Example Source: https://github.com/yoctol/bottender/blob/master/examples/line-liff-v2/README.md Downloads the example project from the Bottender repository and navigates into the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/line-liff-v2 cd line-liff-v2 ``` -------------------------------- ### Initialize a New Bottender Bot Source: https://github.com/yoctol/bottender/blob/master/website/blog/2017-10-31-bottender.md Use the bottender init command to start an interactive process for creating a new bot project. This command will guide you through the setup. ```sh bottender init ``` -------------------------------- ### Run LUIS.ai Example Source: https://github.com/yoctol/bottender/blob/master/examples/with-luis.ai/README.md Command to start the development server in console mode. ```sh npm run dev -- --console ``` -------------------------------- ### Configure Get Started Button Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-messenger-profile.md Set the Get Started button payload in the profile configuration to trigger postback events. ```javascript // bottender.config.js module.exports = { channels: { messenger: { // Omission here... profile: { getStarted: { payload: 'GET_STARTED', }, }, }, }, }; ``` -------------------------------- ### Download and Install Restify Example Source: https://github.com/yoctol/bottender/blob/master/examples/custom-server-restify/README.md Downloads the Restify example project from the Bottender repository and navigates to the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/custom-server-restify cd custom-server-restify ``` -------------------------------- ### Download and Navigate to Slack Modal Update Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-modal-update/README.md Use this command to download the example code and navigate into the project directory. Ensure you have curl and tar installed. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-modal-update cd slack-modal-update ``` -------------------------------- ### Download and Install Telegram Poll Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-poll/README.md Downloads the example project from the Bottender repository and navigates to the directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-poll cd telegram-poll ``` -------------------------------- ### Download and Navigate Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-update-and-delete/README.md Use curl to download the example code and navigate into the example directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-update-and-delete cd slack-update-and-delete ``` -------------------------------- ### Download Messenger Hello World Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-hello-world/README.md Downloads the specific example directory from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-hello-world cd messenger-hello-world ``` -------------------------------- ### Download Example Project Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-persistent-menu/README.md Download the messenger-persistent-menu example from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-persistent-menu cd messenger-persistent-menu ``` -------------------------------- ### Download Slack Modal Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-modal-on-home/README.md Downloads the specific example project from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-modal-on-home cd slack-modal-on-home ``` -------------------------------- ### Download and Navigate Example Source: https://github.com/yoctol/bottender/blob/master/examples/custom-server-express/README.md Use curl to download the example and navigate into the directory. This sets up the project structure for a custom Express server. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/custom-server-express cd custom-server-express ``` -------------------------------- ### Get Started Button Operations Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-messenger-client.md Methods to retrieve, set, or delete the Get Started button payload. ```js client.getGetStarted().then((getStarted) => { console.log(getStarted); // { // payload: 'GET_STARTED', // } }); ``` ```js client.setGetStarted('GET_STARTED'); ``` ```js client.deleteGetStarted(); ``` -------------------------------- ### Download and Navigate Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-batch-multi-pages/README.md Use curl to download the example and then navigate into the directory. This sets up the project structure for the Messenger bot. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-batch-multi-pages cd messenger-batch-multi-pages ``` -------------------------------- ### Download Example Project Source: https://github.com/yoctol/bottender/blob/master/examples/with-aws-lambda/README.md Use curl to download the example project. Ensure you strip the unnecessary parent directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-aws-lambda cd with-aws-lambda ``` -------------------------------- ### Download Slack Hello World Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-hello-world/README.md Downloads the Slack Hello World example project from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-hello-world cd slack-hello-world ``` -------------------------------- ### Download and Extract Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-slash-command/README.md Use curl to download the example code and extract it. Navigate into the example directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-slash-command cd slack-slash-command ``` -------------------------------- ### Download and Extract Example Source: https://github.com/yoctol/bottender/blob/master/examples/line-rich-menu/README.md Use this command to download the example code and navigate to the project directory. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/line-rich-menu cd line-rich-menu ``` -------------------------------- ### Install Dependencies Source: https://github.com/yoctol/bottender/blob/master/examples/custom-server-koa/README.md Installs the necessary project dependencies. ```sh npm install ``` -------------------------------- ### Install @bottender/luis Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-luis/README.md Installation commands for npm and Yarn. ```sh npm install @bottender/luis ``` ```sh yarn add @bottender/luis ``` -------------------------------- ### Install @bottender/qna-maker with Yarn Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-qna-maker/README.md Install the QnA Maker integration package using Yarn. ```sh yarn add @bottender/qna-maker ``` -------------------------------- ### Install QnA Maker Package Source: https://github.com/yoctol/bottender/blob/master/website/docs/advanced-guides-nlu.md Install the @bottender/qna-maker package using your preferred package manager. ```sh npm install @bottender/qna-maker ``` ```sh yarn add @bottender/qna-maker ``` -------------------------------- ### Download Koa Example Source: https://github.com/yoctol/bottender/blob/master/examples/custom-server-koa/README.md Downloads the Koa custom server example from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/custom-server-koa cd custom-server-koa ``` -------------------------------- ### Install @bottender/qna-maker with npm Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-qna-maker/README.md Install the QnA Maker integration package using npm. ```sh npm install @bottender/qna-maker ``` -------------------------------- ### Download and Navigate to LINE Notify Example Source: https://github.com/yoctol/bottender/blob/master/examples/line-notify/README.md Use curl to download the example and cd to navigate into the directory. This sets up the project structure for the LINE Notify integration. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/line-notify cd line-notify ``` -------------------------------- ### Install @bottender/dialogflow with Yarn Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-dialogflow/README.md Install the package using Yarn. ```sh yarn add @bottender/dialogflow ``` -------------------------------- ### Installation Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-rasa/README.md Instructions for installing the @bottender/rasa package using npm or Yarn. ```sh npm install @bottender/rasa # or Yarn add @bottender/rasa ``` -------------------------------- ### Download Slack Modal Push Example Source: https://github.com/yoctol/bottender/blob/master/examples/slack-modal-push/README.md Use curl to download the specific example directory from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/slack-modal-push cd slack-modal-push ``` -------------------------------- ### Start production server Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-telegram-setup.md Launch the application in production mode. ```sh # in production npm start ``` -------------------------------- ### Install and import handlers Source: https://github.com/yoctol/bottender/blob/master/CHANGELOG.md Install the handlers package and import specific platform handlers. ```sh npm install @bottender/handlers // or using yarn: yarn add @bottender/handlers ``` ```js const { middleware, Handler, MessengerHandler, LineHandler, SlackHandler, TelegramHandler, ViberHandler, } = require('@bottender/handlers'); ``` -------------------------------- ### Start Bottender in Production Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-messenger-setup.md Executes the production start command for the Bottender project. ```sh npm start ``` -------------------------------- ### Install ZEIT Now CLI Source: https://github.com/yoctol/bottender/blob/master/website/docs/advanced-guides-deployment.md Installs the ZEIT Now command-line interface globally via npm. ```sh npm install -g now ``` -------------------------------- ### Download Telegram Hello World Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-hello-world/README.md Downloads the Telegram hello world example project from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-hello-world cd telegram-hello-world ``` -------------------------------- ### Download Messenger Built-in NLP Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-built-in-nlp/README.md Downloads the specific example project from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-built-in-nlp cd messenger-built-in-nlp ``` -------------------------------- ### Download Telegram Reply Keyboard Example Source: https://github.com/yoctol/bottender/blob/master/examples/telegram-reply-keyboard/README.md Downloads the specific example directory from the Bottender repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/telegram-reply-keyboard cd telegram-reply-keyboard ``` -------------------------------- ### Install @bottender/rasa Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-rasa/README.md Installation commands for npm and Yarn package managers. ```sh npm install @bottender/rasa ``` ```sh yarn add @bottender/rasa ``` -------------------------------- ### Usage Example Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-rasa/README.md A basic example demonstrating how to use the Rasa integration within a Bottender application. ```javascript const { chain } = require('bottender'); const rasa = require('@bottender/rasa'); async function SayHello(context) { await context.sendText('Hello!'); } async function Unknown(context) { await context.sendText('Sorry, I don’t know what you say.'); } const Rasa = rasa({ origin: 'http://localhost:5005', actions: { greeting: SayHello, }, confidenceThreshold: 0.7, }); module.exports = async function App() { return chain([ Rasa, Unknown, ]); }; ``` -------------------------------- ### Install Serverless Framework Source: https://github.com/yoctol/bottender/blob/master/examples/with-aws-lambda/README.md Install the Serverless Framework globally using npm. This tool simplifies deploying serverless applications. ```sh npm install -g serverless ``` -------------------------------- ### Basic Bottender Router Example Source: https://github.com/yoctol/bottender/blob/master/packages/bottender/README.md This example demonstrates a basic Bottender application structure using the router. It defines handlers for 'hi' text input and a fallback for unknown input. Requires 'bottender' package. ```js // index.js const { router, text } = require('bottender/router'); async function SayHi(context) { await context.sendText('Hi!'); } async function Unknown(context) { await context.sendText('Sorry, I don’t know what you say.'); } module.export = function App(context) { return router([ text('hi', SayHi), text('*', Unknown) ]); } ``` -------------------------------- ### Download and Extract Bottender Example Source: https://github.com/yoctol/bottender/blob/master/examples/messenger-typing/README.md Use curl to download and extract the messenger-typing example from the Bottender GitHub repository. ```sh curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/messenger-typing cd messenger-typing ``` -------------------------------- ### Install Bottender Globally Source: https://github.com/yoctol/bottender/blob/master/website/blog/2017-10-31-bottender.md Install the Bottender CLI globally using npm to access its command-line tools for bot creation and management. ```sh npm install -g bottender ``` -------------------------------- ### Get Console Platform Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-console-context.md Access the platform property to determine if the context is from the console. Requires no setup. ```javascript context.platform; // 'console' ``` -------------------------------- ### Set Persistent Menu Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-messenger-client.md Configures the persistent menu for the bot. A get started button must be set to use this feature. ```js client.setPersistentMenu([ { locale: 'default', callToActions: [ { title: 'Play Again', type: 'postback', payload: 'RESTART', }, { title: 'Language Setting', type: 'nested', callToActions: [ { title: '中文', type: 'postback', payload: 'CHINESE', }, { title: 'English', type: 'postback', payload: 'ENGLISH', }, ], }, { title: 'Explore D', type: 'nested', callToActions: [ { title: 'Explore', type: 'web_url', url: 'https://www.youtube.com/watch?v=v', webviewHeightRatio: 'tall', }, { title: 'W', type: 'web_url', url: 'https://www.facebook.com/w', webviewHeightRatio: 'tall', }, { title: 'Powered by YOCTOL', type: 'web_url', url: 'https://www.yoctol.com/', webviewHeightRatio: 'tall', }, ], }, ], }, ]); ``` -------------------------------- ### Get Sticker File ID in Telegram Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-telegram-sending-messages.md This example shows how to retrieve the `fileId` of a received sticker within a Bottender application. This ID can then be used with `context.sendSticker`. ```javascript module.exports = async function App(context) { if (context.event.isSticker) { await context.sendText( `received the sticker: ${context.event.sticker.fileId}` ); } }; ``` -------------------------------- ### Get Me API Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-telegram-client.md Gets bot's information. ```APIDOC ## GET /getMe ### Description Gets bot's information. ### Method GET ### Endpoint /getMe ### Response #### Success Response (200) - **id** (Number) - The bot's user ID. - **firstName** (String) - The bot's first name. - **username** (String) - The bot's username. #### Response Example ```json { "id": 313534466, "firstName": "first", "username": "a_bot" } ``` ``` -------------------------------- ### Start the development server Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-whatsapp-setup.md Run the development server to begin testing your bot locally. ```sh npx bottender dev ``` -------------------------------- ### Install @bottender/dialogflow with npm Source: https://github.com/yoctol/bottender/blob/master/packages/bottender-dialogflow/README.md Install the package using npm. ```sh npm install @bottender/dialogflow ``` -------------------------------- ### Install dependencies Source: https://github.com/yoctol/bottender/blob/master/README.md Install project dependencies using yarn. ```sh cd bottender yarn ``` -------------------------------- ### GET /debug_token Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-messenger-client.md Gets token information for debugging purposes. ```APIDOC ## GET /debug_token ### Description Gets token information for debugging purposes. ### Method GET ### Endpoint /debug_token ### Response #### Success Response (200) - **appId** (String) - The application ID. - **application** (String) - The application name. - **expiresAt** (Number) - The expiration timestamp of the token. - **isValid** (Boolean) - Indicates if the token is valid. - **issuedAt** (Number) - The issuance timestamp of the token. - **scopes** (Array) - The scopes granted to the token. - **userId** (Number) - The user ID associated with the token. ### Response Example ```json { "appId": "000000000000000", "application": "Social Cafe", "expiresAt": 1352419328, "isValid": true, "issuedAt": 1347235328, "scopes": ["email", "user_location"], "userId": 1207059, } ``` ``` -------------------------------- ### Create a new Bottender app Source: https://github.com/yoctol/bottender/blob/master/README.md Use the CLI tool to initialize a new project. ```sh npx create-bottender-app my-app ``` -------------------------------- ### Run development server Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-telegram-setup.md Start the development server with ngrok to expose the local webhook URL. ```sh # in development npm run dev ``` -------------------------------- ### GET /getGroupMemberIds Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-line-client.md Gets the ID of the users of the members of a group that the bot is in. ```APIDOC ## GET getGroupMemberIds ### Description Gets the ID of the users of the members of a group that the bot is in. ### Parameters #### Path Parameters - **groupId** (String) - Required - ID of the group. - **start** (String) - Optional - continuationToken. ### Response #### Success Response (200) - **memberIds** (Array) - List of user IDs - **next** (String) - Continuation token for pagination ``` -------------------------------- ### GET /getGroupMemberProfile Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-line-client.md Gets the user profile of a member of a group that the bot is in. ```APIDOC ## GET getGroupMemberProfile ### Description Gets the user profile of a member of a group that the bot is in. ### Parameters #### Path Parameters - **groupId** (String) - Required - ID of the group. - **userId** (String) - Required - ID of the user. ### Response #### Success Response (200) - **displayName** (String) - User display name - **userId** (String) - User ID - **pictureUrl** (String) - URL to profile picture ``` -------------------------------- ### GET /getUserProfile Source: https://github.com/yoctol/bottender/blob/master/website/docs/api-line-client.md Gets user profile information for a specific user ID. ```APIDOC ## GET getUserProfile ### Description Gets user profile information. ### Parameters #### Path Parameters - **userId** (String) - Required - ID of the user. ### Response #### Success Response (200) - **displayName** (String) - User display name - **userId** (String) - User ID - **pictureUrl** (String) - URL to profile picture - **statusMessage** (String) - User status message ``` -------------------------------- ### Run Development Server Source: https://github.com/yoctol/bottender/blob/master/examples/line-liff-v1/README.md Commands to start the development server and expose it via ngrok. ```sh npm run dev ``` ```sh npx ngrok http 5000 ``` -------------------------------- ### Install and uninstall dependencies for migration Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-line-migrating-from-sdk.md Commands to swap the LINE SDK for the Bottender framework. ```sh // Using npm npm install bottender@next npm uninstall @line/bot-sdk // Using yarn yarn add bottender@next yarn remove @line/bot-sdk ``` -------------------------------- ### Install and Run Bottender App Source: https://context7.com/yoctol/bottender/llms.txt Use the Bottender CLI to create a new application and then run it in console mode for testing. ```bash npx create-bottender-app my-app cd my-app npm run dev -- --console ``` -------------------------------- ### Quick Overview of Creating a Bottender App Source: https://github.com/yoctol/bottender/blob/master/packages/create-bottender-app/README.md Use this command to quickly create a new Bottender app and start it in console mode. ```sh npx create-bottender-app my-app cd my-app npm start -- --console ``` -------------------------------- ### Install Bottender Source: https://github.com/yoctol/bottender/blob/master/website/blog/2018-08-03-bottender-0_15.md Commands to install the latest version of Bottender using npm or yarn. ```sh $ npm i bottender@latest ``` ```sh $ yarn add bottender@latest ``` -------------------------------- ### Initialize Bot and Server in v0.x index.js Source: https://github.com/yoctol/bottender/blob/master/website/docs/migrating-v1.md Manual instantiation of the bot and session store required in v0.x. ```javascript // index.js const { MessengerBot } = require('bottender'); const { createServer } = require('bottender/express'); const config = require('./bottender.config').messenger; const maxSize = 500; // The maximum size of the cache, default is 500. const bot = new MessengerBot({ accessToken: config.accessToken, appSecret: config.appSecret, verifyToken: config.verifyToken, sessionStore: new MemorySessionStore(maxSize), }); bot.onEvent(async (context) => { await context.sendText('Hello World'); }); const server = createServer(bot); server.listen(5000, () => { console.log('server is running on 5000 port...'); }); ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/yoctol/bottender/blob/master/packages/create-bottender-app/README.md After creating the app, change into the newly created project directory to access its files and commands. ```sh cd my-app ``` -------------------------------- ### Deploy Application with Now CLI Source: https://github.com/yoctol/bottender/blob/master/website/docs/advanced-guides-deployment.md Execute the deployment command to push the application to ZEIT Now. ```bash now ``` -------------------------------- ### Run Development Server Source: https://github.com/yoctol/bottender/blob/master/examples/custom-server-koa/README.md Starts the bot server for development purposes at http://localhost:5000. ```sh npm run dev ``` -------------------------------- ### Install @bottender/handlers Source: https://github.com/yoctol/bottender/blob/master/website/docs/migrating-v1.md Installs the legacy handler package for projects still requiring middleware and Handler classes. ```js npm install @bottender/handlers // or using yarn: yarn add @bottender/handlers ``` -------------------------------- ### Start the Bottender server Source: https://github.com/yoctol/bottender/blob/master/website/docs/channel-line-setup.md Commands to launch the server in either production or development modes. ```sh # in production mode npm start # or in development mode npm run dev ```