-
Notifications
You must be signed in to change notification settings - Fork 55
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
Added hasMatchingEvent implementation #31
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31 +/- ##
============================================
- Coverage 48.22% 47.33% -0.89%
- Complexity 154 158 +4
============================================
Files 8 8
Lines 479 488 +9
============================================
Hits 231 231
- Misses 248 257 +9
Continue to review full report at Codecov.
|
Thank you! Can you add a test for this too? |
Sure, I'll get to it soon. |
@mpociot This was merged but never tagged. Any chance of getting a tagged release? Thank you |
Not sure if this is the place to discuss this. I've just started working on a very crude slackbot that we could use to do some basic actions. I'm mostly using slash commands. Since this merge I've noticed that my Questions aren't working anymore. I think it has to do with this: // If the event type isn't 'message' (which should go through BotMan::hears),
// build a GenericEvent and return it And in Botman we have this listen method: /**
* Try to match messages with the ones we should
* listen to.
*/
public function listen()
{
try {
$isVerificationRequest = $this->verifyServices();
if (! $isVerificationRequest) {
$this->fireDriverEvents();
if ($this->firedDriverEvents === false) {
$this->loadActiveConversation();
if ($this->loadedConversation === false) {
$this->callMatchingMessages();
}
/*
* If the driver has a "messagesHandled" method, call it.
* This method can be used to trigger driver methods
* once the messages are handles.
*/
if (method_exists($this->getDriver(), 'messagesHandled')) {
$this->getDriver()->messagesHandled();
}
}
$this->firedDriverEvents = false;
$this->message = new IncomingMessage('', '', '');
}
} catch (\Throwable $e) {
$this->exceptionHandler->handleException($e, $this);
}
} So first it calls I have an action and that returns with type dialog_submission so I get a GenericEvent fired and that's it. https://api.slack.com/dialogs#response This might be because I don't actually use |
See issue #30.
Hope I didn't mess up anything--seems to do the job in my case at least.