Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (preg_match('/(^Вики\s)(.*?$)/s', $text, $matches)) {
- $request = file_get_contents('https://ru.wikipedia.org/w/api.php?action=opensearch&search={$matches[2]}&limit=1&format=json');
- $response= json_decode($request, true);
- $quoteText = $response;
- Request::sendMessage([
- 'chat_id' => $chat_id,
- 'reply_to_message_id' => $message->getMessageId(),
- 'text' => var_export($quote, true),
- ]);
- exit();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement