Giter VIP home page Giter VIP logo

driver-slack's Introduction

BotMan Slack Driver

BotMan driver to connect Slack with BotMan

Latest Version on Packagist Build Status codecov

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability within BotMan, please send an e-mail to Marcel Pociot at [email protected]. All security vulnerabilities will be promptly addressed.

License

BotMan is free software distributed under the terms of the MIT license.

driver-slack's People

Contributors

crocodele avatar crynobone avatar danielmadu avatar fieg avatar filippotoso avatar joecohens avatar mpociot avatar mrhash avatar sielver 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

Watchers

 avatar  avatar  avatar

driver-slack's Issues

sha1() expects parameter 1 to be string, array given

[2018-07-30 14:07:08] local.ERROR: sha1() expects parameter 1 to be string, array given {"exception":"[object] (ErrorException(code: 0): sha1() expects parameter 1 to be string, array given at /var/www/example.com/vendor/botman/botman/src/Messages/Incoming/IncomingMessage.php:88)
[stacktrace]
#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'sha1() expects ...', '/var/www/growth...', 88, Array)
#1 /var/www/example.com/vendor/botman/botman/src/Messages/Incoming/IncomingMessage.php(88): sha1(Array)
#2 /var/www/example.com/vendor/botman/botman/src/Traits/HandlesConversations.php(173): BotMan\\BotMan\\Messages\\Incoming\\IncomingMessage->getConversationIdentifier()
#3 [internal function]: BotMan\\BotMan\\BotMan->BotMan\\BotMan\\Traits\\{closure}(Object(BotMan\\BotMan\\Messages\\Incoming\\IncomingMessage), 0)
#4 /var/www/example.com/vendor/laravel/framework/src/Illuminate/Support/Arr.php(606): array_filter(Array, Object(Closure), 1)
#5 /var/www/example.com/vendor/laravel/framework/src/Illuminate/Support/Collection.php(471): Illuminate\\Support\\Arr::where(Array, Object(Closure))
#6 /var/www/example.com/vendor/botman/botman/src/Traits/HandlesConversations.php(174): Illuminate\\Support\\Collection->filter(Object(Closure))
#7 /var/www/example.com/vendor/botman/botman/src/BotMan.php(396): BotMan\\BotMan\\BotMan->loadActiveConversation()
#8 /var/www/example.com/app/Http/Controllers/BotmanController.php(19): BotMan\\BotMan\\BotMan->listen()
#9 [internal function]: App\\Http\\Controllers\\BotManController->handle()
// routes/botman.php

<?php

use App\Http\Controllers\BotManController;

$botman = app('botman');

$botman->on('team_join', BotManController::class.'@slackTeamJoin');
// BotMatContrller

<?php

namespace App\Http\Controllers;

use BotMan\BotMan\BotMan;
use App\Conversations\SlackTeamJoin;

class BotManController extends Controller
{
    /**
     * Place your BotMan logic here.
     */
    public function handle()
    {
        $botman = app('botman');

        logger()->info(request()->all());

        $botman->listen();
    }

    /**
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function tinker()
    {
        return view('pages.tinker');
    }

    /**
     * Loaded through routes/botman.php
     *
     * @param  BotMan $bot
     */
    public function slackTeamJoin(BotMan $bot)
    {
        $text = file_get_contents(base_path('core/instructions.md'));

        $bot->replay($text);
    }
}
// logger->info

[2018-07-30 14:07:07] local.INFO: array (
  'token' => 'YdQetlQAzAJJyqNN3RyaKl93',
  'team_id' => 'TBSG4AS8J',
  'api_app_id' => 'ABTRKKFQW',
  'event' =>
  array (
    'type' => 'team_join',
    'user' =>
    array (
      'id' => 'UBZDVG805',
      'team_id' => 'TBSG4AS8J',
      'name' => 'name862',
      'deleted' => false,
      'color' => 'e7392d',
      'real_name' => 'Gigi Lanseta',
      'tz' => 'Europe/Athens',
      'tz_label' => 'Eastern European Summer Time',
      'tz_offset' => 10800,
      'profile' =>
      array (
        'title' => NULL,
        'phone' => NULL,
        'skype' => NULL,
        'real_name' => 'Gigi Lanseta',
        'real_name_normalized' => 'Gigi Lanseta',
        'display_name' => 'gigi',
        'display_name_normalized' => 'gigi',
        'fields' => NULL,
        'status_text' => NULL,
        'status_emoji' => NULL,
        'status_expiration' => 0,
        'avatar_hash' => 'g58edf7ee5c4',
        'image_24' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2F0180%2Fimg%2Favatars%2Fava_0017-24.png',
        'image_32' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0017-32.png',
        'image_48' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0017-48.png',
        'image_72' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0017-72.png',
        'image_192' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0017-192.png',
        'image_512' => 'https://secure.gravatar.com/avatar/58edf7ee5c45c7fa9d33d0ceb50ce45d.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0017-512.png',
        'status_text_canonical' => NULL,
        'team' => 'TBSG4AS8J',
      ),
      'is_admin' => false,
      'is_owner' => false,
      'is_primary_owner' => false,
      'is_restricted' => false,
      'is_ultra_restricted' => false,
      'is_bot' => false,
      'is_app_user' => false,
      'updated' => 1532959260,
      'presence' => 'away',
    ),
    'cache_ts' => 1532959260,
    'event_ts' => '1532959260.000107',
  ),
  'type' => 'event_callback',
  'event_id' => 'EvC0K57FN2',
  'event_time' => 1532959260,
  'authed_users' =>
  array (
    0 => 'UBRSHE0M6',
    1 => 'UBSG4ASR0',
  ),
)

What I'm trying to achieve is when a new member joins the team, have the bot send him the contents of that md file (multi line text)

What am I doing wrong?

The bot is listening to the demo sample code (Hello, Hi)

File and images not receiving in Slack RTM Driver?

  • BotMan Version: 2.0
    -PHP Version: 7.1.7
    -Slack RTM Driver

I'm trying to receive images and file but its seems not working only its hear text
here is my botman.php

<?php
use App\Http\Controllers\BotManController;
use Mpociot\BotMan\Messages\Message;
use BotMan\BotMan\Messages\Attachments\File;
use BotMan\BotMan\Messages\Attachments\Image;
use GuzzleHttp\Client;

$botman = resolve('botman');

$botman->hears('hi', function ($bot) {
    $bot->typesAndWaits(2);
    $bot->reply('Hello!');
}); // its working fine 

$botman->hears('ok', function ($bot) {
    $bot->typesAndWaits(2);
    $bot->reply('anything else!');
}); // its working fine 

$botman->receivesImages(function($bot, $images) {

    foreach ($images as $image) {

        $url = $image->getUrl(); // The direct url
        $title = $image->getTitle(); // The title, if available
        $payload = $image->getPayload(); // The original payload
    }

    $bot->reply('image');
}); //not working 

$botman->receivesFiles(function($bot, $files) {
    foreach ($files as $file) {
        $url = $file->getUrl(); // The direct url
        $payload = $file->getPayload(); // The original payload
    }
      $bot->reply('rec!');
}); // its working fine 

$botman->fallback(function($bot) {
    $bot->reply('I buggy now');
});

When I try to upload any file or image its always fallback problem Also is that when I try upload any file its start looping and again and again repeating "I buggy now' " infinite time unless I'm close that window

I hope you understand my issue I also raise in botman/botman

Too few arguments to function Devristo\Phpws\Protocol\WebSocketTransport::Devristo\Phpws\Protocol\{closure}()

I have following problem when using Slack driver

[19-Jan-2018 14:15:08 Asia/Tokyo] Too few arguments to function Devristo\Phpws\Protocol\WebSocketTransport::Devristo\Phpws\Protocol\{closure}(), 0 passed in /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php on line 123 and exactly 1 expected
[19-Jan-2018 14:15:08 Asia/Tokyo] #0 /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): Devristo\Phpws\Protocol\WebSocketTransport->Devristo\Phpws\Protocol\{closure}()
#1 /var/www/bot/vendor/react/stream/src/Util.php(72): Evenement\EventEmitter->emit('close', Array)
#2 /var/www/bot/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}()
#3 /var/www/bot/vendor/react/stream/src/DuplexResourceStream.php(138): Evenement\EventEmitter->emit('close')
#4 /var/www/bot/vendor/react/stream/src/DuplexResourceStream.php(197): React\Stream\DuplexResourceStream->close()
#5 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #542, Object(React\EventLoop\StreamSelectLoop))
#6 /var/www/bot/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #542, Object(React\EventLoop\StreamSelectLoop))
#7 /var/www/bot/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)
#8 /var/www/bot/app/Console/Commands/E2botSlackCommand.php(63): React\EventLoop\StreamSelectLoop->run()
#9 [internal function]: App\Console\Commands\E2botSlackCommand->handle()
#10 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): call_user_func_array(Array, Array)
#11 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#13 /var/www/bot/vendor/laravel/framework/src/Illuminate/Container/Container.php(549): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#14 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\Container\Container->call(Array)
#15 /var/www/bot/vendor/symfony/console/Command/Command.php(252): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#16 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Command.php(170): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle))
#17 /var/www/bot/vendor/symfony/console/Application.php(938): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/bot/vendor/symfony/console/Application.php(240): Symfony\Component\Console\Application->doRunCommand(Object(App\Console\Commands\E2botSlackCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/bot/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/bot/vendor/laravel/framework/src/Illuminate/Console/Application.php(88): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 /var/www/bot/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(121): Illuminate\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 /var/www/bot/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 {main}

in Devristo\Phpws\Protocol\WebSocketTransport,
$data parameter is not needed in close event ?

        $socket->on("close", function($data) use ($that){
            $that->emit("close", func_get_args());
        });

Bot disconnecting, but loop keeps running

Hi Marcel,
quick question - is slack driver stable enough to be used in production env?

In our case we have noticed that every 2-3 days Slack Bot (Apps) is being marked as disconnected in channel.

Command line script is no killed though, there is no error in command line output (I believe periodic timer executes as well, but need to double check on that).

Our only option is to kill command and restart it. Any advice?

Composer 2 Support?

I have recently updated to Composer 2.0, and there are some packages which do not support it yet. Please see the screenshot below.

image

Let me know if you need any further information.

invalid_attachments_format

Is it possible to reply with attachment to command?

                    $bot->reply('', [
                        "attachments" => json_encode([
                            [
                                "color" => "good",
                                "text" => "No active timers found..."
                            ]
                        ])
                    ]);

It fails with the following error in Slack:

/comamnd failed with the error "invalid_attachments_format"

Laravel 8 support?

I managed to install botman on Laravel 8. Telegram and Microsoft Bot drivers are also successfully installed. But there are problems with the Slack driver.

Installing driver "Slack"
Using version ^2.2 for botman/driver-slack

./composer.json has been updated

Loading composer repositories with package information

Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.


  Problem 1
    - Installation request for botman/driver-slack ^2.2 -> satisfiable by botman/driver-slack[2.2.0].
    - Can only install one of: guzzlehttp/guzzle[7.1.1, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.1.1].
    - Conclusion: install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for guzzlehttp/guzzle (locked at 7.1.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.1.1].



Installation failed, reverting ./composer.json to its original content.

Error installing driver "Slack"

Maybe someone was able to solve this problem?

Multiple reply in slack bot

When I hit a command on my slack app. Its getting multiple replies from the bot. I am using ngrok while developing and I can see the slack is sending multiple request. I couldn't fix this ,whether its from my botman app or the slack app. Has anyone faced this issue. The code is just the one that we get from fresh botman install. In tinker its working fine.

No hasMatchingEvent on SlackDriver (non-RTM one)?

Because SlackDriver doesn't redefine hasMatchingEvent from DriverInterface, there seems to be no way of making use of BotMan's event handler mechanism ($botman->on('event_name', ...)) using this driver.

Instead, it seems that the only way is to use the fallback handler.

Is there a reason for this?

remove echo to stdout in Factory.php

Hi!

I've a problem with \BotMan\Drivers\Slack\Factory::createUsingRTM.
I makes an echo to stdout. Line 71 and 74.
Can you remove this? Or use some logging module for the output? Or a debug / verbose flag?

Thx!
Georg.

Interactive Message buttons not working

Hello There,

I'm having some issues with interactive buttons in a conversation.

I have copied everything relevant from botman studio and everything is working with the exception of buttons and menu list interactions.

When i click a button, i get by fallback message '' Sorry i don't understand that command " As apposed to responding with a joke or quote.

I'm sure i'm missing a configuration or something, but I can't for the life of me figure out what the issue is.

route/botman.php

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

$botman->hears('Hi', function ($bot) {
    $bot->reply('Hello!');
});

$botman->hears('Start conversation', BotManController::class.'@startConversation');

$botman->fallback(function($bot) use ($actions) {
    $bot->reply("Sorry i don't understand that command");
});

Botman controller

    /**
     * Place your BotMan logic here.
     */
    public function handle(Request $request)
    {
            $botman = app('botman');
            $botman->listen();
    }

    public function startConversation(BotMan $bot)
    {
        $bot->startConversation(new ExampleConversation());
    }

Example conversation

<?php

namespace App\Conversations;

use Illuminate\Foundation\Inspiring;
use BotMan\BotMan\Messages\Incoming\Answer;
use BotMan\BotMan\Messages\Outgoing\Question;
use BotMan\BotMan\Messages\Outgoing\Actions\Button;
use BotMan\BotMan\Messages\Conversations\Conversation;
use Illuminate\Support\Facades\Log;

class ExampleConversation extends Conversation
{
    /**
     * First question
     */
    public function askReason()
    {
        $question = Question::create("Huh - you woke me up. What do you need?")
            ->fallback('Unable to ask question')
            ->callbackId('ask_reason')
            ->addButtons([
                Button::create('Tell a joke')->value('joke'),
                Button::create('Give me a fancy quote')->value('quote'),
            ]);

        return $this->ask($question, function (Answer $answer) {
            Log::info("Is interactive reply ? " . $answer->isInteractiveMessageReply());
            $this->say("Is interactive reply ? " . $answer->isInteractiveMessageReply());
            $this->say($answer->getValue());
            if ($answer->isInteractiveMessageReply()) {
                Log::info("Inside interactive message reply");
                Log::Info("Answer value : " . $answer->value());
                if ($answer->getValue() === 'joke') {
                    $responseContent = file_get_contents('http://api.icndb.com/jokes/random');
                    Log::info($responseContent);
                    $joke = json_decode($responseContent);
                    $this->say($joke->value->joke);
                } else {
                    $this->say(Inspiring::quote());
                }
            }
        });
    }

    /**
     * Start the conversation
     */
    public function run()
    {
        $this->askReason();
    }
}

replyInThread isn't working

I've moved botman/botman#907 here, because this is a Slack driver problem.

The parameters in https://github.com/botman/botman/blob/cfa07d5734fdaf2b6cc4c8eb501b747d93c1f2b3/src/BotMan.php#L744-L745 are not suitable for

public function replyInThread($message, $additionalParameters, $matchingMessage)
.

It looks like the BotMan argument is missing (see

public function replyInThread($message, $additionalParameters, $matchingMessage, BotMan $bot)
).

Now when using the method, we need to add an empty array:

$botman->hears('thread', function(BotMan $bot) {
    $bot->replyInThread('Yes', []);
});

But even when I fix that code, I get an error in \BotMan\Drivers\Slack\SlackRTMDriver::buildServicePayload:
PHP Warning: array_replace_recursive(): Argument #2 is not an array in vendor/botman/driver-slack/src/SlackRTMDriver.php on line 254

Support later botman version?

It seems like this driver does not play well with the current master version of botman? Is there any plan to get it updated?

laravel 7 support

Trying to composer require botman/driver-slack but it needs botman-2.5 which is not compatible with laravel 7.x

Is there any way to work around this?

Composer dependencies issues

I spoke to @mpociot after his talk at LaraconEU and told him that I had some issues with the composer dependencies. After manually messing with them, I did get the driver to work perfectly. But not a very clean out-of-the-box experience, but perfect if you like dependency puzzles :-)

What I ended up with is this working combination:

        "botman/botman": "^2.4",
        "botman/driver-slack": "^2.1.3",
        "evenement/evenement": "~3.0",
        "mpociot/phpws": "^2.0",
        "react/event-loop": "^0.4.3",
        "react/stream": "^0.7.5",

Maybe you could look into updated everything, so manually downgrading would not be needed anymore.

Command Parameters is null for interactive request from slack

I send a message to a user with some buttons.

$botman->say('What do you want to do?', [
    'attachments' => json_encode([
        [
            "fallback" => "Shame... buttons aren't supported in this land",
            "callback_id" => "menu_button",
            "color" => "#3AA3E3",
            "attachment_type" => "default",
            'actions' => [
                [
                    "name" => "study",
                    "text" => "study",
                    "type" => "button",
                    "value" => "study",
                ],
            ]
        ],
        [
            "fallback" => "Shame... buttons aren't supported in this land",
            "callback_id" => "menu_button",
            "color" => "#3AA3E3",
            "attachment_type" => "default",
            'actions' => [
                [
                    "name" => "share_knowledge",
                    "text" => "share_knowledge",
                    "type" => "button",
                    "value" => "share_knowledge",
                ]
            ]
        ],
    ])
]);

And I expect parameter {buttonId} to catch any button value.

**
 * @Route("/interactive", name="botman_interactive")
 */
public function interactive()
{
    $this->botman->hears('{buttonId}', function ($bot, $buttonId) {
        $bot->reply('You click button with id  . $buttonId);
    });

    $this->botman->listen();

    return new Response();
}

But $buttonId var is always null

Get requirements error when trying to install slack driver

I get following error for command php artisan botman:install-driver slack:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- botman/driver-slack 2.1.3 requires mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0, 1.1] but these conflict with your requirements or minimum-stability.
- botman/driver-slack 2.1.2 requires mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0, 1.1] but these conflict with your requirements or minimum-stability.
- botman/driver-slack 2.1.1 requires mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0, 1.1] but these conflict with your requirements or minimum-stability.
- botman/driver-slack 2.1.0 requires mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0, 1.1] but these conflict with your requirements or minimum-stability.
- Installation request for botman/driver-slack ^2.1 -> satisfiable by botman/driver-slack[2.1.0, 2.1.1, 2.1.2, 2.1.3].

Bot not responding to mentions in channels

Hi Marcel,

I have set the appropriate permission scopes on the slack website for my bot to respond to mentions in channels.

Somehow when the app is mentioned by me in a channel it does not respond but when I send it a DM it does respond but not when I mention its name in the DM.

Also, I have installed the app into the workspace but it only responds to messages from my. What do other users have to do in order for them to be able to get responses from the bot?

Can't seem to get response from bot reply with SlackRTM

To start of, it might be me, that is a complete fool and the answer could possible stare me right in face. But after an entire day trying to get it to work, I'm desperate.

I can't find a way to get the response back from Slack, when I've pushed a Bot reply to Slack via. the SlackRTM driver.

The reason for wanting the response data, is that I need the returned ts value, so I'm able to update the same posted message at a later stage.

I've never worked with "php promises", I've only touched it during a few node.js projects. But I simply can't wrap my head around how it works "the php way".

So this is what I'm doing:

$response = $bot->reply($response)->then(function (Payload $item) {
    return $item
});

But $response is always just another (empty?) ReactPHP\Promise\Promise object:

React\Promise\Promise^ {#887
  -canceller: null
  -result: null
  -handlers: []
  -progressHandlers: & []
  -requiredCancelRequests: 0
  -cancelRequests: 0
}

If I then try do use done instead of then like I believe I should, according to the section on ReactPHP's documention's regarding the difference.

$response = $bot->reply($response)->done(function (Payload $item) {
    return $item
});

Then $response is simply just null.

The reply it self is posted beautifully to the Slack channel and works like a charm. I just can't seem to figure out how to get the response back from Slack.

I would really appreciate any help, direction or anything like that. Maybe even a short example in the README.md would be awesome 🙈

Issue with PHP8.0+

I have faced the following issue when I have tried to install slack driver.

my composer.json

"require": {
        "php": ">=8.0",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "botman/botman": "^2.7",
        "doctrine/doctrine-bundle": "^2.7",
        "doctrine/doctrine-migrations-bundle": "^3.2",
        "doctrine/orm": "^2.13",
        "symfony/console": "6.1.*",
        "symfony/dotenv": "6.1.*",
        "symfony/flex": "^2",
        "symfony/framework-bundle": "6.1.*",
        "symfony/runtime": "6.1.*",
        "symfony/yaml": "6.1.*"
    },

Here is the output

composer require botman/driver-slack
Using version ^2.2 for botman/driver-slack
./composer.json has been updated
Running composer update botman/driver-slack
Loading composer repositories with package information
The "https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json" file could not be downloaded (HTTP/2 404 )
https://raw.githubusercontent.com/symfony/recipes/flex/main/index.json could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - zendframework/zend-stdlib[2.7.5, ..., 2.7.7] require php ^5.5 || ^7.0 -> your php version (8.1.9) does not satisfy that requirement.
    - zendframework/zend-log[2.7.0, ..., 2.8.3] require php ^5.5 || ^7.0 -> your php version (8.1.9) does not satisfy that requirement.
    - zendframework/zend-log 2.6.0 requires psr/log ~1.0 -> found psr/log[1.0.0, ..., 1.1.4] but the package is fixed to 3.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - zendframework/zend-log[2.9.0, ..., 2.12.0] require php ^5.6 || ^7.0 -> your php version (8.1.9) does not satisfy that requirement.
    - mpociot/phpws[2.0, ..., 2.0.1] require react/socket ^0.8.6 -> found react/socket[v0.8.6, ..., v0.8.12] but the package is fixed to v1.12.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - mpociot/slack-client 1.0 requires react/event-loop ^0.4.1 -> found react/event-loop[v0.4.1, v0.4.2, v0.4.3] but the package is fixed to v1.3.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires botman/driver-slack ^2.2 -> satisfiable by botman/driver-slack[2.2.0, v2.2.1].
    - botman/driver-slack[2.2.0, ..., v2.2.1] require mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0, 1.1, 1.2.0].
    - mpociot/slack-client[1.1, ..., 1.2.0] require mpociot/phpws ^2.0 -> satisfiable by mpociot/phpws[2.0, 2.0.1, 2.1.0].
    - mpociot/phpws 2.1.0 requires zendframework/zend-log 2.* -> satisfiable by zendframework/zend-log[2.0.3, ..., 2.12.0].
    - zendframework/zend-log[2.5.1, ..., 2.5.2] require zendframework/zend-stdlib ~2.5 -> satisfiable by zendframework/zend-stdlib[2.5.0, ..., 2.7.7].
    - zendframework/zend-log 2.5.0 requires zendframework/zend-stdlib ~2.5.0 -> satisfiable by zendframework/zend-stdlib[2.5.0, 2.5.1, 2.5.2].
    - zendframework/zend-log 2.4.13 requires zendframework/zend-stdlib 2.4.13 -> satisfiable by zendframework/zend-stdlib[2.4.13].
    - zendframework/zend-log 2.4.12 requires zendframework/zend-stdlib 2.4.12 -> satisfiable by zendframework/zend-stdlib[2.4.12].
    - zendframework/zend-log 2.4.11 requires zendframework/zend-stdlib 2.4.11 -> satisfiable by zendframework/zend-stdlib[2.4.11].
    - zendframework/zend-log 2.4.10 requires zendframework/zend-stdlib 2.4.10 -> satisfiable by zendframework/zend-stdlib[2.4.10].
    - zendframework/zend-log 2.4.9 requires zendframework/zend-stdlib 2.4.9 -> satisfiable by zendframework/zend-stdlib[2.4.9].
    - zendframework/zend-log 2.4.8 requires zendframework/zend-stdlib 2.4.8 -> satisfiable by zendframework/zend-stdlib[2.4.8].
    - zendframework/zend-log 2.4.7 requires zendframework/zend-stdlib 2.4.7 -> satisfiable by zendframework/zend-stdlib[2.4.7].
    - zendframework/zend-log 2.4.6 requires zendframework/zend-stdlib 2.4.6 -> satisfiable by zendframework/zend-stdlib[2.4.6].
    - zendframework/zend-log 2.4.5 requires zendframework/zend-stdlib 2.4.5 -> satisfiable by zendframework/zend-stdlib[2.4.5].
    - zendframework/zend-log 2.4.4 requires zendframework/zend-stdlib 2.4.4 -> satisfiable by zendframework/zend-stdlib[2.4.4].
    - zendframework/zend-log 2.4.3 requires zendframework/zend-stdlib 2.4.3 -> satisfiable by zendframework/zend-stdlib[2.4.3].
    - zendframework/zend-log 2.4.2 requires zendframework/zend-stdlib 2.4.2 -> satisfiable by zendframework/zend-stdlib[2.4.2].
    - zendframework/zend-log 2.4.1 requires zendframework/zend-stdlib 2.4.1 -> satisfiable by zendframework/zend-stdlib[2.4.1].
    - zendframework/zend-log 2.4.0 requires zendframework/zend-stdlib 2.4.0 -> satisfiable by zendframework/zend-stdlib[2.4.0].
    - zendframework/zend-log 2.3.9 requires zendframework/zend-stdlib 2.3.9 -> satisfiable by zendframework/zend-stdlib[2.3.9].
    - zendframework/zend-log 2.3.8 requires zendframework/zend-stdlib 2.3.8 -> satisfiable by zendframework/zend-stdlib[2.3.8].
    - zendframework/zend-log 2.3.7 requires zendframework/zend-stdlib 2.3.7 -> satisfiable by zendframework/zend-stdlib[2.3.7].
    - zendframework/zend-log 2.3.6 requires zendframework/zend-stdlib 2.3.6 -> satisfiable by zendframework/zend-stdlib[2.3.6].
    - zendframework/zend-log 2.3.5 requires zendframework/zend-stdlib 2.3.5 -> satisfiable by zendframework/zend-stdlib[2.3.5].
    - zendframework/zend-log 2.3.4 requires zendframework/zend-stdlib 2.3.4 -> satisfiable by zendframework/zend-stdlib[2.3.4].
    - zendframework/zend-log 2.3.3 requires zendframework/zend-stdlib 2.3.3 -> satisfiable by zendframework/zend-stdlib[2.3.3].
    - zendframework/zend-log 2.3.2 requires zendframework/zend-stdlib 2.3.2 -> satisfiable by zendframework/zend-stdlib[2.3.2].
    - zendframework/zend-log 2.3.1 requires zendframework/zend-stdlib 2.3.1 -> satisfiable by zendframework/zend-stdlib[2.3.1].
    - zendframework/zend-log 2.3.0 requires zendframework/zend-stdlib 2.3.0 -> satisfiable by zendframework/zend-stdlib[2.3.0].
    - zendframework/zend-log 2.2.10 requires zendframework/zend-stdlib 2.2.10 -> satisfiable by zendframework/zend-stdlib[2.2.10].
    - zendframework/zend-log 2.2.9 requires zendframework/zend-stdlib 2.2.9 -> satisfiable by zendframework/zend-stdlib[2.2.9].
    - zendframework/zend-log 2.2.8 requires zendframework/zend-stdlib 2.2.8 -> satisfiable by zendframework/zend-stdlib[2.2.8].
    - zendframework/zend-log 2.2.7 requires zendframework/zend-stdlib 2.2.7 -> satisfiable by zendframework/zend-stdlib[2.2.7].
    - zendframework/zend-log 2.2.6 requires zendframework/zend-stdlib 2.2.6 -> satisfiable by zendframework/zend-stdlib[2.2.6].
    - zendframework/zend-log 2.2.5 requires zendframework/zend-stdlib 2.2.5 -> satisfiable by zendframework/zend-stdlib[2.2.5].
    - zendframework/zend-log 2.2.4 requires zendframework/zend-stdlib 2.2.4 -> satisfiable by zendframework/zend-stdlib[2.2.4].
    - zendframework/zend-log 2.2.3 requires zendframework/zend-stdlib 2.2.3 -> satisfiable by zendframework/zend-stdlib[2.2.3].
    - zendframework/zend-log 2.2.2 requires zendframework/zend-stdlib 2.2.2 -> satisfiable by zendframework/zend-stdlib[2.2.2].
    - zendframework/zend-log 2.2.1 requires zendframework/zend-stdlib 2.2.1 -> satisfiable by zendframework/zend-stdlib[2.2.1].
    - zendframework/zend-log 2.2.0 requires zendframework/zend-stdlib 2.2.0 -> satisfiable by zendframework/zend-stdlib[2.2.0].
    - zendframework/zend-log 2.1.6 requires zendframework/zend-stdlib 2.1.6 -> satisfiable by zendframework/zend-stdlib[2.1.6].
    - zendframework/zend-log 2.1.5 requires zendframework/zend-stdlib 2.1.5 -> satisfiable by zendframework/zend-stdlib[2.1.5].
    - zendframework/zend-log 2.1.4 requires zendframework/zend-stdlib 2.1.4 -> satisfiable by zendframework/zend-stdlib[2.1.4].
    - zendframework/zend-log 2.1.3 requires zendframework/zend-stdlib 2.1.3 -> satisfiable by zendframework/zend-stdlib[2.1.3].
    - zendframework/zend-log 2.1.2 requires zendframework/zend-stdlib 2.1.2 -> satisfiable by zendframework/zend-stdlib[2.1.2].
    - zendframework/zend-log 2.1.1 requires zendframework/zend-stdlib 2.1.1 -> satisfiable by zendframework/zend-stdlib[2.1.1].
    - zendframework/zend-log 2.1.0 requires zendframework/zend-stdlib 2.1.0 -> satisfiable by zendframework/zend-stdlib[2.1.0].
    - zendframework/zend-log 2.0.8 requires zendframework/zend-stdlib 2.0.8 -> satisfiable by zendframework/zend-stdlib[2.0.8].
    - zendframework/zend-log 2.0.7 requires zendframework/zend-stdlib 2.0.7 -> satisfiable by zendframework/zend-stdlib[2.0.7].
    - zendframework/zend-log 2.0.6 requires zendframework/zend-stdlib 2.0.6 -> satisfiable by zendframework/zend-stdlib[2.0.6].
    - zendframework/zend-log 2.0.5 requires zendframework/zend-stdlib 2.0.5 -> satisfiable by zendframework/zend-stdlib[2.0.5].
    - zendframework/zend-log 2.0.4 requires zendframework/zend-stdlib 2.0.4 -> satisfiable by zendframework/zend-stdlib[2.0.4].
    - zendframework/zend-log 2.0.3 requires zendframework/zend-stdlib 2.0.3 -> satisfiable by zendframework/zend-stdlib[2.0.3].
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.7.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.6.0.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.5.2.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.5.1.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.13.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.12.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.11.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.10.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.9.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.8.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.7.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.6.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.5.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.3.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.2.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.1.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.4.0.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.9.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.8.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.7.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.6.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.5.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.3.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.2.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.1.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.3.0.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.10.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.9.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.8.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.7.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.6.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.5.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.3.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.2.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.1.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.2.0.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.6.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.5.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.3.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.2.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.1.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.1.0.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.8.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.7.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.6.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.5.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.4.
    - friendsofphp/proxy-manager-lts v1.0.12 conflicts with zendframework/zend-stdlib 2.0.3.
    - doctrine/migrations 3.5.2 requires friendsofphp/proxy-manager-lts ^1.0 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.12].
    - doctrine/doctrine-migrations-bundle 3.2.2 requires doctrine/migrations ^3.2 -> satisfiable by doctrine/migrations[3.5.2].
    - doctrine/doctrine-migrations-bundle is locked to version 3.2.2 and an update of this package was not requested.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require botman/driver-slack:*" to figure out if any version is installable, or "composer require botman/driver-slack:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Slack interactive message answer is not working

The payload is received from Slack containing a payload body parameter, itself containing an application/x-www-form-urlencoded JSON string.

{"actions":[{"name":"projects_list","type":"select","selected_options":[{"value":"https://api.freeagent.com/v2/projects/1505467"}]}],"callback_id":"select_project"...

However, getConversationAnswer is never called. And any text message sent after is considered to be an answer and triggers getConversationAnswer function. What could be the problem?

Not getting replies

Using Valet and the document recommended Slack app setup. The web driver works fine and I'm seeing status 200 for when the Slack app connects but just no replies to the messages.

slack does not connect to botman on localhost

This is my routes file in laravel. Am matching any url with /botman that calls a closure which, registers a slack driver for botman and listens to the message hello. In slack am trying to set the Request URL under event subscriptions using this http://127.0.0.1:8000/botman. I get "Your URL didn't respond with the value of the challenge parameter.". What am I missing on my routes file?

<?php
use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;
use BotMan\Drivers\Slack\SlackDriver;
use BotMan\BotMan\Drivers\DriverManager;

Route::match(['get', 'post'],'botman', function () {

    DriverManager::loadDriver(SlackDriver::class);

    // Create BotMan instance
    $config = [
            'slack' => [
                'token' => '***slack Token***' //slack token
                ]
            ];
    $botman = BotManFactory::create($config);

    // give the bot something to listen for.
    $botman->hears('hello', function (BotMan $bot) {
        $bot->reply('Hello yourself.');
    });

    // start listening
    $botman->listen();
});

getBotUserId() returns NULL

When I call the getBotUserId() function, I do not get back the bot user ID but NULL.

Reproduction steps

<?php

use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Drivers\DriverManager;

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../source/config.php';

DriverManager::loadDriver(\BotMan\Drivers\Slack\SlackDriver::class);

$botman = BotManFactory::create($config);

$botman->loadDriver('Slack');
$botUserId = $botman->getDriver()->getBotUserId();

echo $botUserId;
echo gettype($botUserId);

PHP: 7.1.33
Botman: 2.5.0
Slack-Driver: 2.2.0

Bot not responding to other bots in slack.

  • BotMan Version: 1.5.7
  • PHP Version: 7.1.7
  • Messaging Service(s):
    Slack
  • Cache Driver:
    Slack RTM Driver && Slack Rest Driver

Description:

I have been working with the slack RTM driver over the last week in hopes to build a bot that will mainly interact with real users, but occasionally will interact with other bots I have running in my slack. The main feature I want to use bot to bot communication for is allowing my bot to self update.

I have a server provisioned with Laravel Forge, and have a forge bot that posts to a channel in my slack with a success or failed deployment message. What I want to happen is for me to say "hey bot, freshen up", to which my bot would set a flag that it is deploying, make a request to forge to queue deployment, and once the deployment is done, my bot hears the forge bot say "Deployed some fresh code" and then clears the deploying flag and responds "Ok I'm feeling fresh!"

The problem is that my bot does not seem to pick up on listening to other bots, it works with users obviously, but not with other bots. I have tried playing around with the isBot logic in the RTM driver but no luck.

I also was working with Marcel a few weeks back to modify the isBot logic in the slack REST api driver so it could also listen for bots, but had no luck as well. Here is a forked repo where I tried to modify the REST api as well with no luck. https://github.com/charliebois/botman/tree/1.5

Steps To Reproduce:

Provision server with forge.
Setup botman on RTM driver
Setup forge bot to message success to a slack channel
Add botman to the same channel as forge bot
Add a botman hears command to listen for "Username deployed some fresh code!"
Bot will not respond to other bot messages.

Issue with composer dependencies

From what i read i need to include mpociot/slack-client, but that package requires react/event-loop in the 0.4 range which conflicts with botman. Is that slack client maintained by you guys?

Listening for multiple command variations using a single hears()

Version: ^2.1

Is it possible to listen for multiple variations of a command using hears()? For example, I'd like to be able to listen for:

mycommand action (.*)

and

action (.*)

Using | to separate the commands seems to allow execution, though when using regex in both of the commands, the text doesn't seem to come through as expected.

Example Code

$botman->hears('command action (.*)|action (.*)', function ( $botman, $message ) {
    $uid = $botman->getUser()->getId();

    $botman->reply(
        '<@' . $uid . '> You said: ' . $message
    );
});

When the bot hears command action [message], $message comes through without any issues. When the bot hears action [message], $message is empty.

As long as there's not regex, both command variants work, though I need regex in 99% of the commands in use. Perhaps I'm just doing it wrong :).

Demo project

Is there any demo quick "setup" around that I can test?

<?php
require_once "bootstrap.php";


use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;

$config = [
	'slack' => [
		'token' => 'xxx',
	],
];

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

// give the bot something to listen for.
$botman->hears('hello', function (BotMan $bot) {
	$bot->reply('Hello yourself.');
});

// start listening
$botman->listen();

When adding a slack event-subscription it replies with:

Your URL didn't respond with the value of the challenge parameter.

Two Problems: Instructions on originating messages not working, and resulting issues with Drivers.

Hi, I'm trying to originate a message to slack - so I started with using the example here https://botman.io/master/driver-slack

DriverManager::loadDriver(SlackDriver::class);

$o = SlackChannel::findOrFail($this->argument('id'));
$botman = BotManFactory::create([
   'slack' => [
       'token' => $o->slack->getBot()->token,
    ]
]);

(I have confirmed the token is correct.)

I"m getting an error:
Symfony\Component\Debug\Exception\FatalThrowableError : Type error: Argument 1 passed to BotMan\Drivers\Slack\SlackRTMDriver::__construct() must be of the type array, object given,. Not sure why it was falling through to the RTM driver?

1st Problem:
I've put some "dumps" in DriverManager::getMatchingDriver() and see that it first selects BotMan\Drivers\Slack\SlackDriver which appears to fail the tests if ($driver->matchesRequest() || $driver->hasMatchingEvent()) and then selects the BotMan\Drivers\Slack\SlackRTMDriver which causes the exception.

(BTW: I see it correctly connects to slack and gets the BotID and BotUserID.)

So what am I doing wrong here?

2nd Problem:
The fact that the code falls through to the second driver BotMan\Drivers\Slack\SlackRTMDriver the call

new $driver($request, $this->config, $this->http);

is incorrect since SlackRTMDriver::_construct is

__construct(array $config, RealTimeClient $client)

Unable to install

install botman driver-slack

Laravel: 5.5
Botman: 2.1

root@b70a25ba300a:/var/www/html/ombot# composer require botman/driver-slack

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Using version ^1.1 for botman/driver-slack
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

Failed to decode response: zlib_decode(): data error
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: don't install botman/driver-slack 1.1.3
- Conclusion: don't install botman/driver-slack 1.1.2
- Conclusion: don't install botman/driver-slack 1.1.1
- Conclusion: remove evenement/evenement v3.0.1
- Installation request for botman/driver-slack ^1.1 -> satisfiable by botman/driver-slack[1.1.0, 1.1.1, 1.1.2, 1.1.3].
- Conclusion: don't install evenement/evenement v3.0.1
- botman/driver-slack 1.1.0 requires mpociot/slack-client 0.3.* -> satisfiable by mpociot/slack-client[0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4].
- mpociot/slack-client 0.3.0 requires evenement/evenement 2.0.* -> satisfiable by evenement/evenement[v2.0.0].
- mpociot/slack-client 0.3.1 requires evenement/evenement 2.0.* -> satisfiable by evenement/evenement[v2.0.0].
- mpociot/slack-client 0.3.2 requires evenement/evenement 2.0.* -> satisfiable by evenement/evenement[v2.0.0].
- mpociot/slack-client 0.3.3 requires evenement/evenement ~2.0 -> satisfiable by evenement/evenement[v2.0.0, v2.1.0].
- mpociot/slack-client 0.3.4 requires evenement/evenement ~2.0 -> satisfiable by evenement/evenement[v2.0.0, v2.1.0].
- Can only install one of: evenement/evenement[v2.0.0, v3.0.1].
- Can only install one of: evenement/evenement[v2.1.0, v3.0.1].
- Installation request for evenement/evenement (locked at v3.0.1) -> satisfiable by evenement/evenement[v3.0.1].

Installation failed, reverting ./composer.json to its original content.

Can't install

$ composer require botman/driver-slack
Using version ^2.0 for botman/driver-slack
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - botman/driver-slack 2.0.0 requires mpociot/slack-client ~1.0 -> satisfiable by mpociot/slack-client[1.0].
    - Installation request for botman/driver-slack ^2.0 -> satisfiable by botman/driver-slack[2.0.0].
    - Conclusion: remove evenement/evenement v2.1.0
    - Conclusion: don't install evenement/evenement v2.1.0
    - mpociot/slack-client 1.0 requires evenement/evenement ~3.0 -> satisfiable by evenement/evenement[3.0.0, v3.0.1].
    - Can only install one of: evenement/evenement[3.0.0, v2.1.0].
    - Can only install one of: evenement/evenement[v3.0.1, v2.1.0].
    - Installation request for evenement/evenement (locked at v2.1.0) -> satisfiable by evenement/evenement[v2.1.0].


Installation failed, reverting ./composer.json to its original content.

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.