Closed HamasakiBrain closed 9 months ago
public function handle(Request $request, TelegraphBot $bot): void
{
if(isset($request->message['contact'])) {
}
$text = $request->message['text'];
if($text == '/start') {
$this->start();
};
}
public function start(): void
{
$this->service->reading();
$buttons = [
];
if ($this->service->isAdmin($this->chat->chat_id)) {
$buttons[] = Button::make('Panel')->webApp(config('app.url'));
$this->chat->message('Hello!')
->keyboard(Keyboard::make()->buttons($buttons))
->dispatch();
} else {
$keyboard = ReplyKeyboard::make()
->button('Share contact')->requestContact()
->oneTime();
$buttons[] = Button::make('Начать регистрацию')->action('register');
$this->chat->message("Привет")->replyKeyboard($keyboard)
->keyboard(Keyboard::make()->buttons($buttons))
->dispatch();
}
}
When 2 chats or more chats bot not working, error DefStudio\Telegraph\Exceptions\TelegraphException No TelegraphChat defined for this request
Why closed issue ? This problem is not resolve @fabio-ivona
I can't help without a question or a description of your issue, sorry, please open another one describing what is not working
yeah, telegraph requires chat() when replying
Originally posted by @fabio-ivona in https://github.com/defstudio/telegraph/discussions/438#discussioncomment-8132282