diff --git a/README.md b/README.md index 328b779..1709805 100755 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -![image](https://user-images.githubusercontent.com/36935426/159540752-27c64526-b211-4043-826a-7649b855c598.png) +![image](https://user-images.githubusercontent.com/36935426/159934486-08ea58c1-632f-464a-a1e4-beca17871616.png) -[![Develop on Okteto](https://okteto.com/develop-okteto.svg)](https://cloud.okteto.com/#/deploy?repository=https://github.com/hikariatama/Hikka) +[![Develop on Okteto](https://user-images.githubusercontent.com/36935426/159979786-61a598ef-83c8-4c53-9cda-9aea31d61587.png)](https://cloud.okteto.com/#/deploy?repository=https://github.com/hikariatama/Hikka) ## Changes -- Latest Telegram Layers with reactions, video stickers and other stuff -- Security improvements -- UI/UX improvements -- New core modules -- Okteto cloud deployment support -- Quick bug fixes (compared to official FTG) -- Inline Buttons, available not only for core modules, but for every developer -- Inline Galleries for every developer -- Full backward compatibility with older version and with official FTG\GeekTG modules +- 🆕 Latest Telegram Layers with reactions, video stickers and other stuff +- 🔓 Security improvements +- 🎨 UI/UX improvements +- 📼 New core modules +- ☁️ Okteto cloud deployment support +- ⏱ Quick bug fixes (compared to official FTG) +- ▶️ Inline Buttons, available not only for core modules, but for every developer +- 🖼 Inline Galleries for every developer +- 🔁 Full backward compatibility with older version and with official FTG\GeekTG modules +--- ![img](https://user-images.githubusercontent.com/36935426/158634458-424021a3-27c4-494f-9db2-1266f161e7a2.png) - -## Small, but useful +## Last but not the least ### InlineLogs - traceback directly in message, caused error ![img2](https://user-images.githubusercontent.com/36935426/158635869-cc08a053-3bac-4d2e-ad50-30aa77c757fd.png) diff --git a/hikka/main.py b/hikka/main.py index ffa0440..b313b6f 100755 --- a/hikka/main.py +++ b/hikka/main.py @@ -424,7 +424,7 @@ class Hikka: connection_retries=None, ) - client.start(phone=raise_auth) + client.start(phone=raise_auth if web_available else lambda: input("Phone: ")) client.phone = phone self.clients.append(client) @@ -447,7 +447,7 @@ class Hikka: ) continue except InteractiveAuthRequired: - print("Session was terminated and re-auth is required") + print(f"Session {session} was terminated and re-auth is required") continue def _init_loop(self) -> None: diff --git a/hikka/web/root.py b/hikka/web/root.py index 4bb49c7..e751e05 100644 --- a/hikka/web/root.py +++ b/hikka/web/root.py @@ -80,6 +80,9 @@ class Web: return self.clients_set.wait() def _check_session(self, request) -> bool: + if not main.hikka.clients: + return True + return request.cookies.get("session", None) in self._sessions async def set_tg_api(self, request): @@ -189,7 +192,7 @@ class Web: async def web_auth(self, request): if self._check_session(request): - return web.Response(body=request.cookies.get("session")) + return web.Response(body=request.cookies.get("session", "unauthorized")) token = rand(8)