GithubHelp home page GithubHelp logo

docs's People

Contributors

2bj avatar antimech avatar antonioribeiro avatar arshidkv12 avatar baha2odeh avatar baopham avatar carlcassar avatar danielmadu avatar danlopez00 avatar elliotwms avatar eric-famiglietti avatar guiassemany avatar holtkamp avatar j-1000 avatar jaybizzle avatar jeroen-g avatar joedixon avatar johntiror avatar juukie avatar karlisj avatar leedriscoll avatar leonalvarez avatar leonelmenaia avatar lloople avatar lloy0076 avatar mkopinsky avatar mpociot avatar naoray avatar odannyc avatar rickkuilman 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Generate commands from MySQL Table

Hi!

First off, thank you for this framework! I have been building a chatbot with some JS libraries and really wanted a way to protect some of the clever coding I have done. This is a fantastic solution.

One of my current goals to use my nice GUI CRUD editor to build out my conversations.
The script below connects to a Database and creates a command for each row in the table.

However, every response is equal to the last row's response value. Can anyone provide me with a hint on what I should be googling to find a solution? Right now I am focused on Variable Scopes.

Cheers!

Brandon

<?php
use App\Http\Controllers\BotManController;


$servername = "localhost";
$username = "USR";
$password = "PASS";
$dbname = "DB";



$botman = resolve('botman');



// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT id, command, responce, function FROM commands_general";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
     //   echo "<br> id: ". $row["id"]. " - Command: ". $row["command"]. " " . $row["responce"] . "<br>";
     $command = $row["command"];
     $GLOBALS['responce'. $row["id"]] = $row["responce"];
     $GLOBALS['id'] = $row["id"];
       
    $botman->hears($command, function ($bot) {
      global $id;

     // global $responce.$x;
        $bot->reply('heard you '.$id);  
        $id ++;  
});
    }
} else {
    echo "0 results";
}

$conn->close();

Note for loading telegram drivers to receive attachments

It seems I can't reopen #69 , but info is actual and absent in main docs.

You need to manually load corresponding driver to receive attachments, for example:

DriverManager::loadDriver(\BotMan\Drivers\Telegram\TelegramPhotoDriver::class);

Otherwise it silently don't work.

Add it somewhere, plz.
Here: https://github.com/botman/docs/blob/master/driver-telegram.md
or here: https://github.com/botman/docs/blob/master/receiving-additional-content.md .

Should I make PR?

$botman->receivesImages NOT WORKING.

I tried getting the URL of an image sent by the user to the bot so that i can pass it for other functions but i keep getting this error

Uncaught Error: Call to a member function getUrl()
and this other one

/app/vendor/mpociot/botman/src/Mpociot/BotMan/BotMan.php(371): call_user_func_array(Object(Closure), Array)
Here is my code:

require 'vendor/autoload.php';
use Mpociot\BotMan\Messages\Message;
use Mpociot\BotMan\BotManFactory;
use Mpociot\BotMan\BotMan;
use BotMan\BotMan\Messages\Attachments\File;
use BotMan\BotMan\Messages\Attachments\Image;
use BotMan\BotMan\Messages\Outgoing\OutgoingMessage;
use BotMan\Drivers\DriverManager;
$config = [

    // Your driver-specific configuration
     'telegram_token'=>"<token>",
];

// create an instance
$botman = BotManFactory::create($config);

// give the bot something to listen for.
$botman->hears('/start', function (BotMan $bot) {
    $bot->reply('Hello yourself.');
});
   $botman->receivesImages(function($bot,$images) {
  foreach($images as $image){
   $url=$image->getUrl();
   $title=$image->getTitle();
   $bot->reply("hello: ".$url);
  }
});
// start listening
$botman->listen();

When the bot receives an image, it fails to respond. What might be the problem?

Send JS payload in JSON Responce

what is the best way to pass along some JS in my responses. Can I get something like the following code as a response?

"status": 200, "messages": [ { "type": "text", "text": "heard you 2", "script": "alert('Hello World');", "attachment": null, "additionalParameters": [] } ] }

List of available drivers

I notice there are some drivers available that are not listed in the docs (such as discord?). Could a list of all available drivers be added, including drivers built by others?

A 404 page would be nice

When reading the new docs from 2.0 and then switching to 1.5 gives the default laravel error:
schermafbeelding 2018-04-06 om 10 32 29

It would be nice to have a laravel docs like behaviour there:
schermafbeelding 2018-04-06 om 10 33 10

Dialogflow Integration

Can anyone provide a detailed example of the Dialogflow implementation?I have created a bot, using the facebook driver and I want to implement Dialogflow to make the interaction more human. The official BotMan documentations are lack about information on the integration of NLP platforms, the example doesn't help much.
Thank you

No description of the configuration

The documentation seems to lack any description of what the $config variable should contain.

The installation docs under 'Basic Usage without BotMan Studio' stipulate a $config variable, and define it as an array, but not any of the keys.

$config = [
    // Your driver-specific configuration
    // "telegram" => [
    //    "token" => "TOKEN"
    // ]
];

The 'driver-specific configuration' seems to suggest this would be in the driver. However all I could find was the root array key for the driver, but not what any of the configuration key values were.

The BotMan class which takes the $config variable does not type hint $config as an array, so I'm not sure if it has to be an array or not.

My specific use-case is that I'm trying to configure Hipchat, and the documentation for this driver does not detail any of the configuration required.

So I feel at a bit of a dead-end here. This leads me to think there could be some improvements to the documentation made, for those of us who are not using BotMan Studio, or paying for the video course.

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.