SlideShare a Scribd company logo
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 1
CT-Bot Tutorial Author: Avinash Bengeri
This tutorial will show how to build a coding tutor bot using Botpress. The bot offers various programming
languageswhichthe user can choose to learn. On making a choice the bot fetches a video to learn to code in
that language chosen by user.
Requirements
We need to install botpress and that needs node Javascript version >=4.2 and uses npm package manager.
Let’s start!
Follow the below steps carefully. Do not skip any of the steps unless it is performed in advance.
1. InstallingBotpress
As a primary dependency, we need to have npm already installed. So, we now install botpress using the
below command.
npm install -g botpress
2. Creatingprojectfolder/repository
Once we have installedbotpresswe needtocreate afolderof our project.Use the below commandto
create directory.
mkdir ct-bot && cd ct-bot // Mac and Linux users
md ct-bot && cd ct-bot // Windows users
3. InitializingBotpress
Nowlet’sinitializethe botusingthe below commandlineinterface of botpress.
botpress init
On runningthiscommand,we will be promptedtoenterthe name of ourbot,followed by the description,
author and version details. Refer the below screen shot to fill in the details.
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 2
By the end of the successful initialization of botpress we should be able to see the screen as below:
4. InstallingBotpressmodules
We needbotpress-messenger and botpress-rivescript modules to add the interaction feature to our bot.
Use the below command to install these botpress modules.
botpress install messenger rivescript
5. StartingBotpress
Once the modulesare installed,we nowcanstart our bot usingthe below command:
botpress start
We use this command often to restart the bot during development. By running this command a local
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 3
instance of our bot shall be running at http://localhost:3000. Check this from any of the web browsers. If
everything is installed fine and the bot is running, then it shall appear as below.
We can alsoinstall modules of botpress here, just by a click of button in the webpage. However, now we
have alreadyinstalled the required modules by command line, so it is not required to do it from here. To
stop the bot, use Ctrl+C and to start it again use the command mentioned above.
6. Configuring Messenger connection settings
Before startingtocode,we needto configure the messengerappsothat our bot issynchronizedwithit.Let
us configure the Facebook Messenger for our bot. Our bot requires App ID, App Secret, and Token Access
of the Facebook messenger app. Follow the below instructions:
6.1. If you do not have a Facebook page, then create a new Facebook page.
6.2. Sign up to developers.facebook.com using your Facebook credentials.
6.3. At the top rightof the page move your mouse over “My Apps” button, and click on “Add a New App”.
6.4. Provide display name and contact email. Select category as “Apps for Messenger” and click “Create
App ID” button.
6.5. Now your messenger app is created. Scroll down to Token Generation where you can select your
Facebook page and get the Page Access Token.
6.6. Click on the Settings button in the menu at the left of the page. Here we get App ID and App Secret.
6.7. We nowhave AppID, AppSecretand TokenAccessas perthe requirementtoourbot. Once we set up
our bot only youcan interactandtestthe botbecause Facebook takes3-4 businessdaystoreviewthe
app before granting “pages_messaging” privilege.
Copythe App ID,App SecretandTokenAccessof messengerappwe justcreated,andpaste it inMessenger
module of ourbot. At http://localhost:3000,clickon Messengertabin the leftandfill inthe details. Do not
worry about Hostname for now. Check the “Use ngrok” checkbox. Click “Save & Connect”.
At this point our bot is up and running. You can verify this by sending a message to your Facebook page
that you created. Open a chat tab on your Facebook page and type BOT_LICENSE. The bot should answer
your user message, as below:
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 4
Note:BOT_LICENSE is a Botpresscommandtodisplaybasicinformationaboutyourbot(name,version,
licenses).
7. GettingYoutube APIkey
We need to be able to connect to Youtube through our bot and thus we need the Youtube API key.
ObtainingyourownAPI key is very simple and easy. Go to console.developers.google.com. Create a new
projectand youwill have the API key for it. A simple google query will be able to help you find this. Save
this Youtube API key, as we need this later.
8. Importingnpmpackages
To proceedbuildingourCodingTutorBotwe needfew npmpackagestobe installed.Installthemusing
commandsbelow:
npm install bluebird // https://bluebirdjs.com
npm install lodash // https://lodash.com
npm install axios // https://www.npmjs.com/package/axios
Note that before youstartinstallingthese packages,we needtostopthe botusingCtrl+C inthe node js
commandprompt.
Once we install all packageswe are goodto start coding.
9. Coding
9.1. Index.js
Copycontentsof belowfile andpaste itinthe index.js file of ourbot(ct-botindex.js).
Observe thatwe have importedbluebirdandlodashpackagesatthe start of index.js.
9.2. Videos.js
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 5
In the bot folder(ct-bot),create anew file as‘videos.js’.Copycontentfrombelow file andpaste itin
‘videos.js’youjustcreated.
Observe thatwe have importedaxiosandlodashpackagesinthisfile.Recall thatwe hadsaved
YOUTUBE_API_KEY earlier.We make use of ithere.Inthe videos.jsfile,inplace of
‘<YOUR_YOUTUBE_API_KEY>’, paste yourYoutube APIKey.
9.3. Star.rive
In the bot folderstructure(ct-botdatarivescript),there are twofiles;begin.riveandstar.rive.These
are basicrivescriptfileswhichallow ustomake ourbot respondtouser.Use the contentsof below
star.rive file andpaste itinthe star.rive file atthislocation:[ct-botdatarivescript]
LearningRivescriptiseasyandgooddocumentationisavailable ininternet.Tostart with,the following
linkisgood:https://www.rivescript.com/docs/tutorial
10. We are Done
Finally,we have ourbotready.Restartthe bot fromthe node jscommandprompt.Get startedtextingthe
bot.Have fun!
References:
1. https://docs.botpress.io/
2. https://github.com/botpress/
SnapShots
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 6
Clickon GetStarted
Clickon anyof the buttons,foreg: Python
ClickWatch
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 7
Go back and try somethinglikethis.
City College of City University of New York _
__________________________________________________________________________________________
Adv. Topicsin Internet Programming 8

More Related Content

What's hot

SELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UISELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UI
Manasa Dilipkumar
 
BeEF
BeEFBeEF
Windows 8 app template feedback
Windows 8 app template feedbackWindows 8 app template feedback
Windows 8 app template feedback
Steren Giannini
 
Call ringout app
Call ringout appCall ringout app
Call ringout app
Khadhar Koneti
 
Exbrowser command-reference
Exbrowser command-referenceExbrowser command-reference
Exbrowser command-reference
eminentbandit9928
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Joshua Warren
 
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadminHow to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
Sandy Ra
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
David Alger
 
Hyvä: Compatibility Modules
Hyvä: Compatibility ModulesHyvä: Compatibility Modules
Hyvä: Compatibility Modules
vinaikopp
 
FirefoxOs App Development by Adam
FirefoxOs App Development by Adam FirefoxOs App Development by Adam
FirefoxOs App Development by Adam
Mohammed Adam
 
Flash messages in node js using connect flash module
Flash messages in node js using connect flash moduleFlash messages in node js using connect flash module
Flash messages in node js using connect flash module
Katy Slemon
 
Build your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automationBuild your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automation
Winton Winton
 
Secure mvc application saineshwar
Secure mvc application   saineshwarSecure mvc application   saineshwar
Secure mvc application saineshwar
Saineshwar bageri
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
Max Pronko
 
How to become a Joomla! Tester
How to become a Joomla! TesterHow to become a Joomla! Tester
How to become a Joomla! Tester
Marc DECHEVRE
 

What's hot (15)

SELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UISELENIUM SCRIPTS FOR DASHBOARD UI
SELENIUM SCRIPTS FOR DASHBOARD UI
 
BeEF
BeEFBeEF
BeEF
 
Windows 8 app template feedback
Windows 8 app template feedbackWindows 8 app template feedback
Windows 8 app template feedback
 
Call ringout app
Call ringout appCall ringout app
Call ringout app
 
Exbrowser command-reference
Exbrowser command-referenceExbrowser command-reference
Exbrowser command-reference
 
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
Magento 2 Dependency Injection, Interceptors, and You - php[world] 2015
 
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadminHow to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
How to install and configure microsoft iis 7.5, php, my sql, and phpmyadmin
 
Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015Fundamentals of Extending Magento 2 - php[world] 2015
Fundamentals of Extending Magento 2 - php[world] 2015
 
Hyvä: Compatibility Modules
Hyvä: Compatibility ModulesHyvä: Compatibility Modules
Hyvä: Compatibility Modules
 
FirefoxOs App Development by Adam
FirefoxOs App Development by Adam FirefoxOs App Development by Adam
FirefoxOs App Development by Adam
 
Flash messages in node js using connect flash module
Flash messages in node js using connect flash moduleFlash messages in node js using connect flash module
Flash messages in node js using connect flash module
 
Build your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automationBuild your first rpa bot using IBM RPA automation
Build your first rpa bot using IBM RPA automation
 
Secure mvc application saineshwar
Secure mvc application   saineshwarSecure mvc application   saineshwar
Secure mvc application saineshwar
 
Magento 2 Design Patterns
Magento 2 Design PatternsMagento 2 Design Patterns
Magento 2 Design Patterns
 
How to become a Joomla! Tester
How to become a Joomla! TesterHow to become a Joomla! Tester
How to become a Joomla! Tester
 

Similar to Ct bot tutorial

Appium_set_up
Appium_set_upAppium_set_up
Appium_set_up
Mithilesh Singh
 
Streamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxStreamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptx
ShubhamJayswal6
 
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and  Visual StudioCreating and Deploying a Bot Service Using the Bot Framework and  Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
Murray Fife
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...
harshalpatil183931
 
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdfPERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
arfa442827
 
How to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step GuideHow to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step Guide
Ace Web Academy -Career Development Center
 
Android app development guide for freshers by ace web academy
Android app development guide for freshers  by ace web academyAndroid app development guide for freshers  by ace web academy
Android app development guide for freshers by ace web academy
Ace Web Academy -Career Development Center
 
codeit_pre-training kit.pptx
codeit_pre-training kit.pptxcodeit_pre-training kit.pptx
codeit_pre-training kit.pptx
RuvelAlbino1
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
scandiweb
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
Mithilesh Singh
 
Dynamics 365 self hosting bots
Dynamics 365 self hosting botsDynamics 365 self hosting bots
Dynamics 365 self hosting bots
Amit Patil
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
CodeOps Technologies LLP
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
kesavan N B
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
Mithilesh Singh
 
Essentials of developing_tizen_web_application_en_1.0
Essentials of developing_tizen_web_application_en_1.0Essentials of developing_tizen_web_application_en_1.0
Essentials of developing_tizen_web_application_en_1.0
Saima Ashiq
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
Ritwik Das
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-start
Dennis Seidel
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf
 
Summary Of Polycom Cast App
Summary Of Polycom Cast AppSummary Of Polycom Cast App
Summary Of Polycom Cast App
Giddaluri Madhavi
 

Similar to Ct bot tutorial (20)

Appium_set_up
Appium_set_upAppium_set_up
Appium_set_up
 
Streamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptxStreamlining React Component Development and Sharing with bit.pptx
Streamlining React Component Development and Sharing with bit.pptx
 
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and  Visual StudioCreating and Deploying a Bot Service Using the Bot Framework and  Visual Studio
Creating and Deploying a Bot Service Using the Bot Framework and Visual Studio
 
MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...MAD mobile application development you can learn from here , we perform all c...
MAD mobile application development you can learn from here , we perform all c...
 
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdfPERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
PERTEMUAN 3_INTRO TO ANDROID APP DEV.pdf
 
How to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step GuideHow to build your own Android App -Step by Step Guide
How to build your own Android App -Step by Step Guide
 
Android app development guide for freshers by ace web academy
Android app development guide for freshers  by ace web academyAndroid app development guide for freshers  by ace web academy
Android app development guide for freshers by ace web academy
 
codeit_pre-training kit.pptx
codeit_pre-training kit.pptxcodeit_pre-training kit.pptx
codeit_pre-training kit.pptx
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
Appium- part 1
Appium- part 1Appium- part 1
Appium- part 1
 
Dynamics 365 self hosting bots
Dynamics 365 self hosting botsDynamics 365 self hosting bots
Dynamics 365 self hosting bots
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
Browser_Stack_Intro
Browser_Stack_IntroBrowser_Stack_Intro
Browser_Stack_Intro
 
Essentials of developing_tizen_web_application_en_1.0
Essentials of developing_tizen_web_application_en_1.0Essentials of developing_tizen_web_application_en_1.0
Essentials of developing_tizen_web_application_en_1.0
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-start
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
Summary Of Polycom Cast App
Summary Of Polycom Cast AppSummary Of Polycom Cast App
Summary Of Polycom Cast App
 

Recently uploaded

Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 

Recently uploaded (20)

Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 

Ct bot tutorial

  • 1. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 1 CT-Bot Tutorial Author: Avinash Bengeri This tutorial will show how to build a coding tutor bot using Botpress. The bot offers various programming languageswhichthe user can choose to learn. On making a choice the bot fetches a video to learn to code in that language chosen by user. Requirements We need to install botpress and that needs node Javascript version >=4.2 and uses npm package manager. Let’s start! Follow the below steps carefully. Do not skip any of the steps unless it is performed in advance. 1. InstallingBotpress As a primary dependency, we need to have npm already installed. So, we now install botpress using the below command. npm install -g botpress 2. Creatingprojectfolder/repository Once we have installedbotpresswe needtocreate afolderof our project.Use the below commandto create directory. mkdir ct-bot && cd ct-bot // Mac and Linux users md ct-bot && cd ct-bot // Windows users 3. InitializingBotpress Nowlet’sinitializethe botusingthe below commandlineinterface of botpress. botpress init On runningthiscommand,we will be promptedtoenterthe name of ourbot,followed by the description, author and version details. Refer the below screen shot to fill in the details.
  • 2. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 2 By the end of the successful initialization of botpress we should be able to see the screen as below: 4. InstallingBotpressmodules We needbotpress-messenger and botpress-rivescript modules to add the interaction feature to our bot. Use the below command to install these botpress modules. botpress install messenger rivescript 5. StartingBotpress Once the modulesare installed,we nowcanstart our bot usingthe below command: botpress start We use this command often to restart the bot during development. By running this command a local
  • 3. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 3 instance of our bot shall be running at http://localhost:3000. Check this from any of the web browsers. If everything is installed fine and the bot is running, then it shall appear as below. We can alsoinstall modules of botpress here, just by a click of button in the webpage. However, now we have alreadyinstalled the required modules by command line, so it is not required to do it from here. To stop the bot, use Ctrl+C and to start it again use the command mentioned above. 6. Configuring Messenger connection settings Before startingtocode,we needto configure the messengerappsothat our bot issynchronizedwithit.Let us configure the Facebook Messenger for our bot. Our bot requires App ID, App Secret, and Token Access of the Facebook messenger app. Follow the below instructions: 6.1. If you do not have a Facebook page, then create a new Facebook page. 6.2. Sign up to developers.facebook.com using your Facebook credentials. 6.3. At the top rightof the page move your mouse over “My Apps” button, and click on “Add a New App”. 6.4. Provide display name and contact email. Select category as “Apps for Messenger” and click “Create App ID” button. 6.5. Now your messenger app is created. Scroll down to Token Generation where you can select your Facebook page and get the Page Access Token. 6.6. Click on the Settings button in the menu at the left of the page. Here we get App ID and App Secret. 6.7. We nowhave AppID, AppSecretand TokenAccessas perthe requirementtoourbot. Once we set up our bot only youcan interactandtestthe botbecause Facebook takes3-4 businessdaystoreviewthe app before granting “pages_messaging” privilege. Copythe App ID,App SecretandTokenAccessof messengerappwe justcreated,andpaste it inMessenger module of ourbot. At http://localhost:3000,clickon Messengertabin the leftandfill inthe details. Do not worry about Hostname for now. Check the “Use ngrok” checkbox. Click “Save & Connect”. At this point our bot is up and running. You can verify this by sending a message to your Facebook page that you created. Open a chat tab on your Facebook page and type BOT_LICENSE. The bot should answer your user message, as below:
  • 4. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 4 Note:BOT_LICENSE is a Botpresscommandtodisplaybasicinformationaboutyourbot(name,version, licenses). 7. GettingYoutube APIkey We need to be able to connect to Youtube through our bot and thus we need the Youtube API key. ObtainingyourownAPI key is very simple and easy. Go to console.developers.google.com. Create a new projectand youwill have the API key for it. A simple google query will be able to help you find this. Save this Youtube API key, as we need this later. 8. Importingnpmpackages To proceedbuildingourCodingTutorBotwe needfew npmpackagestobe installed.Installthemusing commandsbelow: npm install bluebird // https://bluebirdjs.com npm install lodash // https://lodash.com npm install axios // https://www.npmjs.com/package/axios Note that before youstartinstallingthese packages,we needtostopthe botusingCtrl+C inthe node js commandprompt. Once we install all packageswe are goodto start coding. 9. Coding 9.1. Index.js Copycontentsof belowfile andpaste itinthe index.js file of ourbot(ct-botindex.js). Observe thatwe have importedbluebirdandlodashpackagesatthe start of index.js. 9.2. Videos.js
  • 5. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 5 In the bot folder(ct-bot),create anew file as‘videos.js’.Copycontentfrombelow file andpaste itin ‘videos.js’youjustcreated. Observe thatwe have importedaxiosandlodashpackagesinthisfile.Recall thatwe hadsaved YOUTUBE_API_KEY earlier.We make use of ithere.Inthe videos.jsfile,inplace of ‘<YOUR_YOUTUBE_API_KEY>’, paste yourYoutube APIKey. 9.3. Star.rive In the bot folderstructure(ct-botdatarivescript),there are twofiles;begin.riveandstar.rive.These are basicrivescriptfileswhichallow ustomake ourbot respondtouser.Use the contentsof below star.rive file andpaste itinthe star.rive file atthislocation:[ct-botdatarivescript] LearningRivescriptiseasyandgooddocumentationisavailable ininternet.Tostart with,the following linkisgood:https://www.rivescript.com/docs/tutorial 10. We are Done Finally,we have ourbotready.Restartthe bot fromthe node jscommandprompt.Get startedtextingthe bot.Have fun! References: 1. https://docs.botpress.io/ 2. https://github.com/botpress/ SnapShots
  • 6. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 6 Clickon GetStarted Clickon anyof the buttons,foreg: Python ClickWatch
  • 7. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 7 Go back and try somethinglikethis.
  • 8. City College of City University of New York _ __________________________________________________________________________________________ Adv. Topicsin Internet Programming 8