![]() If you have any question feel free to add it in comments. In this tutorial I tried to give you main idea on how easy it is to create Viber bot that can be use for various purposes in real world scenario. Those that exceed that range will be eligible to send up to one. If you followed all steps from this tutorial you should be able to run application successfully by issuing following command: BOT_ACCOUNT_TOKEN=4996c3171f27d609-d9b5a30ddffde554-2752e040f32da392 EXPOSE_URL= node index.js Conclusion Starting April 1, Viber will charge chatbot operators 4,500 per month for the ability to send up to 500,000 messages to users. You have to use SSL protocol for this, plan HTTP can not be used. Chatbots can combine the steps of complex processes to streamline and automate common and repetitive. In this case will be used as EXPOSE_URL environment variable. Chatbot Advantages AI-powered conversational interfaces. #Viber chat bot update#If everything goes well you should report like this: ngrok by (Ctrl+C to quit) Session Status online Session Expires 7 hours, 59 minutes Update update available (version 2.3.27, Ctrl-U to update) Version 2.3.15 Region United States (us) Web Interface Forwarding -> Forwarding -> Connections ttl opn rt1 rt5 p50 p90 0 0 0.00 0.00 0.00 0.00 You must choose port on which your application is running locally. For such purpose we can use Ngrok- a reverse proxy that creates a secure tunnel from a public endpoint to a locally running web service. If you want to set Webhook and receive updates you will need create secure tunnel from public endpoint to locally running application. #Viber chat bot how to#If any of following environment variables is missing app should terminate. In this post, I am going to share how to develop Viber Chat Bot in 6 simple steps using PHP. In index.js file include following code: const ViberBot = require(‘viber-bot’).Bot, BotEvents = require(‘viber-bot’).Events, TextMessage = require(‘viber-bot’).Message.Text, express = require(‘express’) const app = express() Check for environment variables #Viber chat bot install#You can install it by issuing following command: npm i -save express viber-bot Include modules and create Express application It should be fine for test project.Ĭreate index.js: touch index.js Install dependenciesįor this project you will need express and viber-bot installed. Press enter multiple times to accept all default. To create package.json run following command: npm init If you have no chatbot in you project, use. If you already have convigured Viber bot in your project, just create adapter by implementing interface ViberClientInterface. Storage must implement SubscribersRepositoryInterface. If you are on OSX/Linux user you can use following bash command to do it mkdir viber-cat-vet-bot cd viber-cat-vet-bot Initialise package.json First we need to implement storage where subscribed Viber users and their roles will be stored. ![]() ![]() This blog will lead you step by step to successfully create simple working application. Last step to make use of Viber bot is to create NodeJS application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |