driver-slack
driver-slack copied to clipboard
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)
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
Issue still present
issue still present