You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function searchFaq(): void
{
$buttons = [];
$buttons[] = Button::make('Поиск')->switchInlineQuery()->currentChat();
$keyboard = Keyboard::make()->buttons($buttons);
$this->sendMsg('Что бы начать поиск, нажмите на кнопку', $keyboard);
}
and in the main handler
public function handleInlineQuery(InlineQuery $inlineQuery): void
{
$bot = TelegraphBot::whereId(1)->first();
$synonyms = $inlineQuery->query();
$question = $this->faqService->searchFaqBySynonyms($synonyms);
$result[] = InlineQueryResultArticle::make('1', 'Ничего не найдено');
if ($question->count() > 0) {
$result = [];
foreach ($question as $item) {
$result[] = InlineQueryResultArticle::make($item->id, $item->question);
}
}
$bot->answerInlineQuery($inlineQuery->id(), $result)->send();
}
in BotFather /setInline it is written
local development via ngrok and webhook installations. Nothing works, not even just what if nothing was found
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There is an implementation of a search button
public function searchFaq(): void
{
$buttons = [];
$buttons[] = Button::make('Поиск')->switchInlineQuery()->currentChat();
$keyboard = Keyboard::make()->buttons($buttons);
$this->sendMsg('Что бы начать поиск, нажмите на кнопку', $keyboard);
}
and in the main handler
{
$bot = TelegraphBot::whereId(1)->first();
$synonyms = $inlineQuery->query();
$question = $this->faqService->searchFaqBySynonyms($synonyms);
$result[] = InlineQueryResultArticle::make('1', 'Ничего не найдено');
if ($question->count() > 0) {
$result = [];
foreach ($question as $item) {
$result[] = InlineQueryResultArticle::make($item->id, $item->question);
}
}
$bot->answerInlineQuery($inlineQuery->id(), $result)->send();
}
in BotFather /setInline it is written
local development via ngrok and webhook installations. Nothing works, not even just what if nothing was found
Beta Was this translation helpful? Give feedback.
All reactions