Skip to content

kapstahillar/TalkBot

Repository files navigation

MIT License

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Contact

About The Project

screenshot1

This is highly scalable TalkBot that allows user to input questions or commands and bot returns back
command result.
Scalable part is because it uses plugins to add functionality to it and command execution is
interfaced with async commands, so it does not matter if command logic happens in only client
side or command needs to execute functions with remote API

(back to top)

Built With

(back to top)

Getting Started

Prerequisites

This is an example of how to list things you need to use the software and how to install them.

Note: php.ini has to have extension=fileinfo enabled for project to work.

  • install composer using php
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Installation

  1. Clone the repo
    git clone https://github.com/kapstahillar/TalkBot.git
  2. Change directory to TalkBot
    cd ./TalkBot
  3. Install composer packages
    composer install
    
  4. Install npm packages
    npm install
    
  5. Run webmix
    npm run watch
    
  6. Rename file .env.example to .env
  7. Generate new application key
    php artisan key:generate
    
  8. Run development server
    php artisan serve
    
  9. Open up brower and open localhost:8000

(back to top)

Usage

Add Talkbot to your frontend with tag:

<TalkBot/>  

Usage in example:

This bot should talk, but it doesn't do it currently. This bot only know's 2 commands /calculate and /convert

/calculate 

calculate takes in 1 parameters in format <number><+-*/><number> and returns result of calculation

Example:

/calculate 1*2
/calculate 4.23+1.3 
/convert 

calculate takes in 3 parameters. First parameters have to be <number> and other 2 two are currency tag strings like EUR or USD

Example:

/convert 23141 EUR USD
/convert 300 AUD USD

Issues

Convert request might fail on localhost because of SSL Certificate. Below is a guide how to fix this

  1. Go to https://curl.se/docs/caextract.html and download cacert.pem
  2. Put is somewhere where php can access it. I used C://xampp in my windows build
  3. Add those two lines to you php.ini file (Do know what PHP you are using use: php --ini)
curl.cainfo = <path_to_cert>\cacert.pem
openssl.cafile= <path_to_cert>\cacert.pem

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Hillar Kapsta - [email protected] LinkedIn: https://www.linkedin.com/in/hillar-kapsta-908614a6/ Project Link: https://github.com/kapstahillar/TalkBot

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published