diff --git a/README.md b/README.md index 1709805..4e90961 100755 --- a/README.md +++ b/README.md @@ -1,45 +1,93 @@ -![image](https://user-images.githubusercontent.com/36935426/159934486-08ea58c1-632f-464a-a1e4-beca17871616.png) +

Installation

+ -[![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 +
+

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 + +
+

Requirements

+ +
+

Documentation

---- -![img](https://user-images.githubusercontent.com/36935426/158634458-424021a3-27c4-494f-9db2-1266f161e7a2.png) - -## 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) ---- -### Grep - execute command and get only required lines -![img3](https://user-images.githubusercontent.com/36935426/158636369-389241e6-bb9c-474b-bcfd-7493503d91dd.png) ---- -### NoNick, NoNickUser, NoNickCmd - enable global nonickname feature -![img4](https://user-images.githubusercontent.com/36935426/158637220-00495363-cf4a-4e6f-a4b2-51d693906ead.png) ---- -### Requirements - -- Python 3.8 or above -- Requirements from `requirements.txt` -- Optional: API ID and Hash from [Telegram](https://my.telegram.org/apps) or default ones, if your Telegram account is old enough -- Optional: Some basic knowledge of terminal - -### Documentation - -Check out the folder `docs` for developers' documentation +Check out the folder docs for developers' documentation User docs will be available soon +
+

Support

+
+

Features

+ + + + + + + + + +
+ Forms - bored of writing? Use buttons! + + Galleries - scroll your favorite photos in Telegram +
+ + + +
+ + + + + + + + + +
+ Inline - share userbot with your friends + + Bot interactions - "No PM"? No problem. Feedback bot at your service +
+ + + +
+ + + + + + + + + +
+ InlineLogs - traceback directly in message, caused error + + Grep - execute command and get only required lines +
+ + + +
-### Support - -[Support Group](https://t.me/hikka_talks "Telegram"). +👨‍👦 NoNick, NoNickUser, NoNickCmd - use another account for userbot + diff --git a/hikka/inline/gallery.py b/hikka/inline/gallery.py index 6def797..c61e827 100644 --- a/hikka/inline/gallery.py +++ b/hikka/inline/gallery.py @@ -195,6 +195,9 @@ class Gallery(InlineUnit): "force_me": force_me, } + if isinstance(message, Message): + await (message.edit if message.out else message.respond)("👩‍🎤 Loading inline gallery...") + try: q = await self._client.inline_query(self.bot_username, gallery_uid) m = await q[0].click( @@ -237,7 +240,7 @@ class Gallery(InlineUnit): self._galleries[gallery_uid]["chat"] = utils.get_chat_id(m) self._galleries[gallery_uid]["message_id"] = m.id - if isinstance(message, Message) and message.out: + if isinstance(message, Message): await message.delete() asyncio.ensure_future(self._load_gallery_photos(gallery_uid)) @@ -297,7 +300,8 @@ class Gallery(InlineUnit): ) except RetryAfter as e: await call.answer( - f"Got FloodWait. Wait for {e.timeout} seconds", show_alert=True + f"Got FloodWait. Wait for {e.timeout} seconds", + show_alert=True, ) except Exception: logger.exception("Exception while trying to edit media") @@ -398,9 +402,13 @@ class Gallery(InlineUnit): def _get_next_photo(self, gallery_uid: str) -> str: """Returns next photo""" - return self._galleries[gallery_uid]["photos"][ - self._galleries[gallery_uid]["current_index"] - ] + try: + return self._galleries[gallery_uid]["photos"][ + self._galleries[gallery_uid]["current_index"] + ] + except IndexError: + logger.error(f"Got IndexError in `_get_next_photo`. {self._galleries[gallery_uid]['current_index']=} / {len(self._galleries[gallery_uid]['photos'])=}") + return self._galleries[gallery_uid]["photos"][0] def _get_caption(self, gallery_uid: str) -> str: """Calls and returnes caption for gallery"""