Code Monkey home page Code Monkey logo

magento-chatbot's Introduction

Magento Chatbot Module (Telegram, Messenger, Whatsapp, WeChat and Skype)

Chatbots! They're all the rage: Telegram has them, Facebook wants them, and it seems like every computer coder wants to make them. But what are they? And why is every company suddenly hot on this new A.I. trend?

Chatbots are computer programs that you interact with via a chat interface. Using a chatbot is as simple as having a conversation with it. You can ask it questions or give it commands, and it'll respond to you and carry out your actions. Chatbots can be run in any number of chat apps, including Facebook Messenger, your phone's text messaging app, and most others.

Become part of the chatbots revolution. Download the latest version here.

IMPORTANT

We're currently refactoring all our codebase and database structure, so we renamed the Magento1 folder to Magento1_deprecated, the new Magento1 module should be ready before January/2018. To access the deprecated Magento1 version click here

About

This repository is the source code for the Magento Chatbot (Telegram, Messenger, Whatsapp, WeChat and Skype), with this module you can fully integrate your Magento store with the most popular chat apps in the market. This means that by simply installing this module and a few clicks you can have a new way to show and sell your products to your clients. Very easy to use! Try now, it's FREE.

To use this module you'll need to have SSL enabled in your store, this is a requirement from Facebook and Telegram, not by me.

For a complete documentation on how to use (specially for advanced wit.ai configuration) access Magento Chatbot Documentation.

For now only Facebook Messenger is implemented.

A big thanks to Eleirbag89 who wrote this simple PHP wrapper for Telegram.

APIs

PLEASE REPORT ALL BUGS that you find. It's hard to do QA only by myself

Features

  • Messages Queue
  • wit.ai integration for NLP
  • List store categories
  • List products from category
  • Search for products
  • Add product to cart (Currently not working with Configurable Products and products with custom options)
  • Clear cart
  • Login/Logout to your account
  • List orders
  • Track order status
  • Reorder
  • Send email
  • Custom fallback messages

Languages

  • English (US)

Installation

  1. Unpack the extension ZIP file in your Magento root directory
  2. Clear the Magento cache: System > Cache Management
  3. Log out the Magento admin and log back in to clear the ACL list
  4. Recompile if you are using the Magento Compiler

Usage

For a complete documentation on how to use (specially for advanced wit.ai configuration) access Magento Chatbot Documentation.

Go to System > General Settings > Chatbot Settings

General Configuration

  • Your Secret Key: This is Your Custom Secret Key Used to Activate/Deactivate The API Webhook
  • List Empty Categoies: Enable Listing of Categories With No Products or Unallowed Products
  • Enable Log: Enable Log. Log will be at root/var/log/.
  • Enable witAI Integration: Enable witAI Integration
  • witAI API Key: witAI API Key

Facebook Configuration

  • Enable Messenger Bot: Enable Messenger Bot
  • Unavailability Message: Message To Send When Bot Is Disabled. Leave It Empty To Send No Message. Please Check The Maximum Size For Messages On Telegram API, Otherwise Your Message Might Not Be Sent.
  • Page Access Token: Your Page Access Token.
  • Messenger Welcome Message: First Message The Bot Will Send To Your Client.
  • Messenger Help Message: Message Will be Sent When Customer Asks For Help.
  • Messenger About Message: Message Will be Sent When Customer Asks For About.
  • Commands List: Code of the commands and it's alias
  • Enable Natural Language Processor Replies: Enable Natural Language Processor replies.
  • Natural Language Processor Entity Prefix: Natural Language Processor entity prefix is a prefix name to flag that the request is coming from Messenger.
  • Natural Language Processor Replies: Replies to be send to the customer whenever matches one of the requirements.

Screenshot

General Settings

ScreenShot

Messenger Settings

ScreenShot

Conversation

ScreenShot

Queue Workflow

ScreenShot

Release Notes

Magento2

  • v1.0.7:
    • Fix unserialization problem #146 (thanks xmav)
  • v1.0.6:
    • Update license
    • Fix issue #142
    • Minor bugs fixes
  • v1.0.5:
    • Add Promotional Messages
    • Add Messenger Chatbox
  • v1.0.4:
    • Add Support command
    • Add option to list commands on Help Command
    • Add Default Replies
    • Add Welcome Message Options
  • v1.0.3:
    • Add Messages Queue Modes
    • Add option to Clear Message Queue
    • Add price to product list
    • Add condition to only handle messages from Messenger
    • Add new configuration tab
    • Fix some bugs
    • Add bugs to fix later
  • v1.0.2:
    • Add Messages Queue
    • Add List More command
    • Add error message when trying to list product from a nonexistent category
    • Fix problem when trying to reorder
    • Fix problem when trying to add a product to cart
    • Fix other payload problems
    • Small code improvements
    • Fix parameter problem when processing outgoing message
  • v1.0.1:
    • Fix missing parameter on CLI installation (issue #120)
    • Fix get on Messenger payload message
  • v1.0.0:
    • First working version
    • Messenger integration
    • wit.ai integration for NLP
    • List store categories
    • List products from category
    • Search for products
    • Add product to cart
    • Clear cart
    • Login/Logout to your account
    • List orders
    • Track order status
    • Reorder
    • Send email
    • Custom fallback messages
    • Much more

Magento1

Deprecated versions

  • v0.0.18:
    • Add missing cron file
    • Fix module version
  • v0.0.17:
    • Add Abandoned Cart messages
    • Enable all types of products to be listed
    • Update module license for MIT license
  • v0.0.16:
    • Code improvements
    • Fix flood of messages when disabling bot for human respond
    • [Backend] Add module version to configuration
    • Update wit.ai API version
    • [Backend] Add options/commands to Welcome Message
  • v0.0.15:
    • First stable version
    • Add option to ignore certain messages using Default Replies
    • Add Customer Chat ID to message for support
    • Add module tables update from previous versions
  • v0.0.14:
    • Fix problem when setting Telegram Webhook
    • Fix problem when sending message between different chat plataforms
    • Fix small translation problems
    • Code improvements
  • v0.0.13:
    • Code improvements
    • Add admin commands listing on Telegram
    • Fix problem when receiving 503 from wit.ai
    • [Backend] Add option to disable Bot replies on Facebook (good for when a you need to reply on Page Messages)
    • [Backend] Add option to open Messenger Box with referral
    • [Backend] Add option to write the customer name in a message using "{customername}"
    • Default Replies are now able to send big texts
    • Order listing now uses Facebook Receipt layout
  • v0.0.12:
    • Fix command alias
    • Fix list categories command glitch
    • Fix some other small glitches
    • Code improvements
    • Add Facebook Live Chat on store frontend
    • [Customer] Speech recognition for Telegram
    • [Backend] Option to enable/disable speech recognition
    • [Backend] Layout improvements
  • v0.0.11:
    • Fix logout command glitch
    • Fix some other small glitches
    • Code improvements
    • Fix problem when replying a customer on support mode
    • [Backend] Integration with wit.ai
    • [Backend] Use wit.ai as match for a default reply
    • [Customer] Add option do enable/disable receiving promotional messages
  • v0.0.10:
    • [Backend] Add option to match a 'default reply' as a command
    • [Backend] Add default fallback message
    • [Backend] Add option to disable Telegram inline search
  • v0.0.9:
    • [Customer] Add inline search for Telegram
    • Add price to product listing on Telegram
    • Fix category buttons listing glitch on Telegram
    • Fix regex validation
    • Fix webhook security issue
    • New webhook URL
  • v0.0.8:
    • [Backend] Add "starts with", "ends with", "contains", "equals to" and "regex" options to Default Replies
    • [Backend] Better backend layout
    • [Backend] Better way to enable/disable commands
  • v0.0.7:
    • [Backend] Fix problems with URL
    • [Customer] Add register command
    • Add Chinese translation (big thanks to leedssheung)
    • Show command list on "help" instead of "about"
    • Fix buttons size on Telegram when listing categories
    • [Backend] Add option to stop processing when sending a default reply
  • v0.0.6:
    • [Backend] Better admin descriptions and typos
  • v0.0.5:
    • [Backend] Add Default Replies
    • [Backend] Add option to unavailability message
    • Better feedback messages
  • v0.0.4:
    • Fix glitch on order listing
    • Fix glitchs with product search and category listing
    • Better feedback messages
    • [Customer] Add logout command
    • [Admin] Add feature to send message to all customers
    • [Admin] Add option to enable/disable support for a customer
  • v0.0.3:
    • Limit products/orders listing
    • Add stock validation for listing
    • [Backend] Add option to enable/disable empty categories listing
    • [Customer] Add search by SKU
  • v0.0.2:
    • Facebook integration
    • [Admin] Cross platform messages with support mode
  • v0.0.1:
    • Telegram integration
    • First working version

F.A.Q.

Q: When the other chatbots integrations are going to be ready?

A: I'm not sure, I work in my free hours. I'm trying to finish it ASAP. Pull requests are very welcome.

Q: Can you implement <???> function/bot integration?

A: I can try. Open a issue and I'll see what I can do.

Q: Your bot is awesome. How can I help?

A: Thank you! You can help by codding more features, creating pull requests, or donating using Bitcoin: 1BdL9w4SscX21b2qeiP1ApAFNAYhPj5GgG

TODO

  • Integrations:
    • Whatsapp
    • WeChat
    • Microsoft Bot Framework / Skype
    • ???
  • Features:
    • Documentation / Tutorials / Videos
    • Add a custom in-store message chat app
    • Save support history
    • Support for audio commands
    • Better uses for wit.ai
    • Force a command for a customer
    • Integrate checkout to Facebook Payment API
    • Add compatibility with configurable products
    • Add compatibility with products with custom options
    • Add "abandoned cart" messages
    • Add CDATA and <tooltip> to configuration descriptions
    • Add Referral Message
    • Add more options to filter clearing message queue
    • Add handler for other posts from Messenger

License

MIT License

Copyright (c) 2018 blopa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Free Software, Hell Yeah!

magento-chatbot's People

Contributors

blopa avatar leedssheung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento-chatbot's Issues

Improvements and Option to Push, browse and schedule Magento CMS Notifications

Hi @blopa

Firstly, great work with the Magento chatbot. It's an awesome feature for Magento 1.

  1. Are there any plans for Magento 2? Some ideas https://github.com/vrann/magebot
    https://magento.stackexchange.com/questions/144120/how-to-use-rabbitmq-in-magento2-ce

  2. It would be useful to push, browse and schedule Magento CMS notification updates to the subscribers. Because the average subscriber needs content engagement, quiz interaction, browse offers and product benefits updates to keep engaged with the page. Product checkout happens as a side effect of the content updates and engagement. So this would be a useful feature because chabot is missing vital part of store content ie creating awareness, engagement and storytelling.

     Attached few example screens - which can be scheduled and relayed from - Magento CMS.
    
  3. Also, option to checkout within webview would be a great feature without having to leave the chatbot. Is this possible? Thank you.

screen shot 2017-10-16 at 9 27 12 am

screen shot 2017-10-16 at 9 43 36 am

screen shot 2017-10-16 at 9 44 53 am

screen shot 2017-10-16 at 10 13 07 am

screen-shot-2017-07-25-at-3-37-46-pm

screen-shot-2017-07-25-at-2-11-42-pm

screen-shot-2017-07-25-at-2-12-02-pm1

screen shot 2017-10-16 at 9 55 15 am

Match challenge issue with Facebook

I have installed your module, created facebook dev account and application, copied Facebook page's token and pasted in the module's facebook configuration section. Please have a look:

image

Also, I have entered the custom key:

image

Next, I have successfully accessed to the below URL:

https://codeinlabs.com/chatbot/chatdata/facebook/webhook/fayyaz123

image

It is showing to copy call back URL and verify token to the facebook webhook. But when I paste the information as mentioned earlier on facebook messenger webhook, it gives me the below error:

The URL couldn't be validated. Response does not match challenge, expected value=

Please see the screenshot as well:

image

I am using Magento v1.9.3.6 with PHP v5.6 and MySQL v5.6. Do you have any solution for it?

Product opens with a long url instead of [rewrite product url]

When you click on product to opens it in the website view the url chatbot provides does not open as the url of store is shorter [rewrite product url] and this given long url doesnt open, not sure if its just my stores issue or not. I just want it to return a working url .
1
2

Magento 2

I run your plugin for Magento 2 but there is a problem:

 Werules\Chatbot\Block\Webhook\Messenger
                Missed required argument request in parent::__construct call. File: /var/www/html/application/app/code/Werules/Chatbot/Block/Webhook/Messenger.php
Total Errors Count: 1


  [Magento\Framework\Validator\Exception]
  Error during compilation

proper License

Hey, providing it for Free is great, and sorry to nag with this topic.

But you may reach a point, where you need to decide for a proper license, and then things get complicated(from a legal perspective) if you already had several contributions.

The problem is, you need the ok from others, if you want to put their contributions under a different license.

Order Notifications on facebook

I appreciate your work, I have a feature request it would be great if you add feature that can send order notifications direct on messenger. notifications such as order shipment, when order status change, invoice update etc.
image

image

@blopa Thanks a bunch and keep up the good work!

Improvements?

Wouldnt this be a good idea? Get started button when starting messenger, then a welcome message with option to chat with support or search for products, etc?

skjermbilde 2017-09-13 kl 11 57 27

Saving model

Hi. Where do you save the chatbot model? When I try to get $chatdata = Mage::getModel('chatbot/chatdata')->load($chatId, 'facebook_chat_id'); I can't get $chatdata->getFacebookMessageId() and others. In database all records have default values NULL and 0.

Something went wrong, please try again.

Hello!

Tried setting up default replies, tried all options possible and I only get:
"Something went wrong, please try again." all the time. Anyone experiencing this issue? - Thomas

Messenger Settings Fatal Error

Hi guys, your project look nice but i have this bug on Messenger Settings from admin pannel

`1 exception(s):
Exception #0 (InvalidArgumentException): Unable to unserialize value.

Exception #0 (InvalidArgumentException): Unable to unserialize value.
#0 /data/demo/src/current/app/code/Magento/Config/Model/Config/Backend/Serialized.php(55): Magento\Framework\Serialize\Serializer\Json->unserialize('\n\t\t\t\t\ta:16:{s:1...')
#1 /data/demo/src/current/lib/internal/Magento/Framework/Model/AbstractModel.php(601): Magento\Config\Model\Config\Backend\Serialized->_afterLoad()
#2 /data/demo/src/current/generated/code/Magento/Config/Model/Config/Backend/Serialized/ArraySerialized/Interceptor.php(323): Magento\Framework\Model\AbstractModel->afterLoad()
#3 /data/demo/src/current/app/code/Magento/Config/Block/System/Config/Form.php(441): Magento\Config\Model\Config\Backend\Serialized\ArraySerialized\Interceptor->afterLoad()
#4 /data/demo/src/current/app/code/Magento/Config/Block/System/Config/Form.php(349): Magento\Config\Block\System\Config\Form->getFieldData(Object(Magento\Config\Model\Config\Structure\Element\Field\Interceptor), 'werules_chatbot...')
#5 /data/demo/src/current/app/code/Magento/Config/Block/System/Config/Form.php(325): Magento\Config\Block\System\Config\Form->_initElement(Object(Magento\Config\Model\Config\Structure\Element\Field\Interceptor), Object(Magento\Framework\Data\Form\Element\Fieldset), 'werules_chatbot...', '', '')`

Any idea ?

Magento 1

Hi,

Do you know when the extension for Magento 1 will be available for testing?

Best regards :-)
Jesper Brejning

Webhook URL not generating

Hello,

I have setup your extension for Facebook Chat Bot. I have filled all the information. Now I am facing problem in accessing the url with custom key.

When I try to hit https://www.techgetgo.com/chatbot/chatdata/facebook/key/4574er5ehiy/ I receive the following message.

To configure Facebook webhook access https://developers.facebook.com/apps/(FACEBOOK_APP_ID)/webhooks/ and set the webhook URL as https://www.techgetgo.com/chatbot/chatdata/facebook/key/4574er5ehiy/

After this when I go to FB developer interface and try to setup the webhook URL I receive the error message. Please check the screenshot below.

fbb

Now please tell me which configuration I am missing.

Thanks

Webhook URL generation problem

When I try to verify my Callback URL in FB app I have callback message like "The URL couldn't be validated. Response does not match challenge, expected value="1717583312", received="{"status":"success"}" "

I configurated all options in magento and status is of course "success", but why facebook want numeric value?

I have already read issues #31 and #60

I don't have any idea what is wrong or what I do wrong.

This is my URL: https://demo.onlineua.org/index.php/chatbot/chatdata/facebook/key/mr686WIBBp/

list_categories not working

Hello,

So I managed to setup Facebook Chat Bot communicating (uncompiled issue 61) but it stops responding after running list_categories

image

Magento Setup on my side is multi store with configurable products.

Does it work with Telegram ? (Magento 2 version)

Hi
I am wonder if there any draft user guide on how to configure it with Telegram ?

(From the code it looks like telegram is not supported yet in Magento 2 module version. Am I right ?)

Thanks

[ANNOUNCEMENT] Magento 2 version

Hello all.

After a long period of thinking, I've decided I'll rebuild the extension from scratch for Magento 2, using some new features and messaging queue. This module is a great module with amazing features, but there are many code-fix that need to be done, as is my first big module, so I'll focus on rebuilding it with better architecture for M2 and after I've done that, I'll refactor most of the Magento 1.x version and that will probably fix tons of glitches.

I use my free time to work on this project, so I can't promise dates or anything. I'm always open to new pull requests, please don't be shy, let's work together to make this free module awesome.

Thank you very much for everyone that supports this projects with new ideas for features.

Best,
Pablo

Not replying

First of all, i would like to say thanks for making this open-source bot for Magento.
I integrated all the setting Please check ss below

image

image

image
image

I have tried to message bot via my own account, it's not replying. :(

image

If you can help me It will be appreciated. In waiting for your quick response. @blopa

Thanks

not displaying newly added products

I've added some products to the website, but the bot is not displaying those products, I've refreshed all the cache and re-indexed. is there any way to refresh products data in bot database?

image

in waiting for quick response @blopa thanks in advance

Regards,

Include Path Issue

Hello,

I also have setup your extension for Facebook Chat Bot. I have filled all the information. Now I am facing problem in accessing the url with the custom key.

After making a call to http://www.website.com/chatbot/chatdata/facebook/key/69398037409
I get the following PHP error
Fatal error: require_once(): Failed opening required 'Api/witAI/witAI.php' (include_path='/var/www/htdocs/lib/minify:/var/www/htdocs/includes/src:.:/usr/local/lib/php') in /var/www/htdocs/includes/src/Werules_Chatbot_Model_Chatdata.php on line 7

If I view my var/log/system.log it's basically the same problem
2017-06-20T16:33:41+00:00 ERR (3): Warning: require_once(Api/witAI/witAI.php): failed to open stream: No such file or directory in /var/www/htdocs/includes/src/Werules_Chatbot_Model_Chatdata.php on line 7
2017-06-20T16:33:54+00:00 ERR (3): Warning: require_once(Api/witAI/witAI.php): failed to open stream: No such file or directory in /var/www/htdocs/includes/src/Werules_Chatbot_Model_Chatdata.php on line 7

Any idea on how to fix this? Oh and great work on this :)

Something went wrong Error

the bot was working fine but I sent a checkout command, after it started to give me an error. also I checked there is nothing inside log folder.

image

In waiting for your quick response. @blopa

Regards

Messenger Settings Not Loaded

Hello,

I have a problem with my Magento 2 shop, the Messenger Settings page is not loaded.
But the general settings page is working fine.

image

Just two questions

I appreciate your work, and I just wanted to ask:

  1. can this chatbot be used for abandoned cart messages in FB messenger
  2. will it work for configurable products soon?

Thanks a bunch and keep up the good work!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.