Closed andrewklau closed 7 years ago
Well you could use the reply method outside of the listener callbacks, but you need to specify the channel, recipient, etc. nonetheless. How did you do this using the old version of this package?
There is no such thing as being initialized because BotMan only responds to incoming webhooks.
$slackbot = new \SlackBot();
$slackbot::reply('hello', [
'channel' => 'dev',
'username' => 'Bot',
'icon_emoji' => ':robot_face:',
]);
Doing this with BotMan no longer seems to work anymore, do we need to pass the driver in?
Ah right. That will no longer work because BotMan doesn't know which driver to use.
Sol it'd be best to pass the driver classname to the rely method in this case.
But isn't that basically the "fallback" method you're looking for?
Do you have an example of how to to pass the driver classname into the reply method?
It's currently not possible to do this.
Please take a look at the fallback
method, which gets triggered if no keyword matches your bot:
Thanks, I guess we'll stick to SlackBot for a while.
It's more our app uses both the bot and sending bot initiated messages for other notifications. I'll look into submitting a PR if I get some time.
Thanks!
With SlackBot it was possible to use the
reply
outside of the standard hear etc to send a message. Is there a way to specify the driver to keep using this functionality?ie. bot initiated message