queryId = $rawCallback['query_id']; $this->userId = $rawCallback['user_id']; $this->chatInstance = $rawCallback['chat_instance']; } /** * @param string $message Popup to show * @param bool $alert Whether to show the message as a popup instead of a toast notification * @param string|null $url URL to open * @param int $cacheTime Cache validity (default set to 5 min based on telegram official docs ...) */ public function answer( string $message, bool $alert = false, ?string $url = null, int $cacheTime = 5 * 60 ): bool { return $this->getClient()->methodCallAsyncRead( 'messages.setBotCallbackAnswer', [ 'query_id' => $this->queryId, 'message' => $message, 'alert' => $alert, 'url' => $url, 'cache_time' => $cacheTime, ], ); } }