defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
674 stars 116 forks source link

Cannot use session() helper to store data in custom WebHooks handler #530

Closed jialeee17 closed 7 months ago

jialeee17 commented 7 months ago

In the custom WebHooks handler, I try to store some data via the Laravel "session()" global helper function but it didn't work as expected. There's no session was created. For example,

public function connect() { try { session(['data' => '123']); } catch (Exception $e) { Log::channel('telegram')->error($e->getMessage()); $this->chat->html(ChatService::error())->send(); } }

fabio-ivona commented 7 months ago

Already answered in discussions