Skip to content

Commit

Permalink
fix conversation for callback queries
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeghi committed Dec 24, 2020
1 parent f2f7843 commit d90f782
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Zanzara/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public function getUpdate(): ?Update
*
* This callable must be take on parameter of type Context
* @param $handler
* @param bool $skipListeners
* @param bool $skipListeners if true the conversation handler has precedence over the listeners, so the listener
* callbacks are not executed.
* @return PromiseInterface
* @throws \DI\DependencyException
* @throws \DI\NotFoundException
Expand Down
6 changes: 3 additions & 3 deletions src/Zanzara/Listener/ListenerResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public function resolveListeners(Update $update): PromiseInterface
$chatId = $update->getEffectiveChat() ? $update->getEffectiveChat()->getId() : null;
if ($chatId) {
$this->conversationManager->getConversationHandler($chatId)
->then(function ($handler) use ($deferred, &$listeners) {
if ($handler) {
$listeners[] = new Listener($handler, $this->container);
->then(function ($handlerInfo) use ($deferred, &$listeners) {
if ($handlerInfo) {
$listeners[] = new Listener($handlerInfo[0], $this->container);
}
$deferred->resolve($listeners);
})->otherwise(function ($e) use ($deferred) {
Expand Down

0 comments on commit d90f782

Please sign in to comment.