Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
leenooks opened this issue May 28, 2018 · 3 comments

Comments

@leenooks
Copy link

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)

@Lobosque
Copy link

I just came across the exact same problem. @leenooks I wonder if it might be an API update on botman/botman that is not yet reflected on botman/driver-slack

@rakshazi
Copy link

rakshazi commented Jun 4, 2019

Issue still present

@ismaelcanales
Copy link

issue still present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants