Update README.md, minor fixes

pull/1/head
hikari.ftg 2022-03-28 21:47:30 +00:00
parent cf22d576f0
commit 12d833d0dd
2 changed files with 100 additions and 44 deletions

126
README.md
View File

@ -1,45 +1,93 @@
![image](https://user-images.githubusercontent.com/36935426/159934486-08ea58c1-632f-464a-a1e4-beca17871616.png)
<h2><img src="https://github.com/hikariatama/assets/raw/master/1326-command-window-line-flat.webp" height="54" align="middle"> Installation</h2>
<img src="https://github.com/hikariatama/assets/raw/master/install.gif">
[![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)
<a href="https://cloud.okteto.com/#/deploy?repository=https://github.com/hikariatama/Hikka"><img src="https://user-images.githubusercontent.com/36935426/159979786-61a598ef-83c8-4c53-9cda-9aea31d61587.png" height="60"></a>
## Changes
<hr>
<h2><img src="https://github.com/hikariatama/assets/raw/master/35-edit-flat.webp" height="54" align="middle"> Changes</h2>
- 🆕 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
<ul>
<li>🆕 Latest Telegram Layers with reactions, video stickers and other stuff</li>
<li>🔓 Security improvements</li>
<li>🎨 UI/UX improvements</li>
<li>📼 New core modules</li>
<li>☁️ Okteto cloud deployment support</li>
<li>⏱ Quick bug fixes (compared to official FTG)</li>
<li>▶️ Inline Buttons, available not only for core modules, but for every developer</li>
<li>🖼 Inline Galleries for every developer</li>
<li>🔁 Full backward compatibility with older version and with official FTG\GeekTG modules</li>
</ul>
<hr>
<h2 border="none"><img src="https://github.com/hikariatama/assets/raw/master/1312-micro-sd-card-flat.webp" height="54" align="middle"> Requirements</h2>
<ul>
<li>Python 3.8 or above</li>
<li>Requirements from <code>requirements.txt</code></li>
<li>Optional: API ID and Hash from <a href="https://my.telegram.org/apps" color="#2594cb">Telegram</a> or default ones, if your Telegram account is old enough</li>
<li>Optional: Some basic knowledge of terminal</li>
</ul>
<hr>
<h2 border="none"><img src="https://github.com/hikariatama/assets/raw/master/680-it-developer-flat.webp" height="54" align="middle"> Documentation</h2>
---
![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 <code>docs</code> for developers' documentation
User docs will be available soon
<hr>
<h2 border="none"><img src="https://github.com/hikariatama/assets/raw/master/981-consultation-flat.webp" height="54" align="middle"> <a href="https://t.me/hikka_talks">Support</a></h2>
<hr>
<h2 border="none"><img src="https://github.com/hikariatama/assets/raw/master/541-hand-washing-step-12-flat.webp" height="54" align="middle"> Features</h2>
<table>
<tr>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/1286-three-3-key-flat.webp" height="32" align="middle"><b> Forms - bored of writing? Use buttons!</b>
</td>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/61-camera-flat.webp" height="32" align="middle"><b> Galleries - scroll your favorite photos in Telegram</b>
</td>
</tr>
<tr>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160475881-8463537a-265e-472a-9b1e-ede8b1cc3380.gif">
</td>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160475809-c171c5ff-010c-472c-903a-de9b8a2c61cc.gif">
</td>
</tr>
</table>
<table>
<tr>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/216-arrow-5-flat.webp" height="32" align="middle"><b> Inline - share userbot with your friends</b>
</td>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/1054-amazon-echo-speaker-flat.webp" height="32" align="middle"><b> Bot interactions - "No PM"? No problem. Feedback bot at your service</b>
</td>
</tr>
<tr>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160475934-02e6df9d-e73a-42fc-99c7-8b12d1015336.gif">
</td>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160476037-9537f1c7-8b72-408f-b84c-b89825930bf5.gif">
</td>
</tr>
</table>
<table>
<tr>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/1140-error-flat.webp" height="32" align="middle"><b> InlineLogs - traceback directly in message, caused error</b>
</td>
<td>
<img src="https://github.com/hikariatama/assets/raw/master/35-edit-flat.webp" height="32" align="middle"><b> Grep - execute command and get only required lines</b>
</td>
</tr>
<tr>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160475684-86d11e83-832e-43fc-89d8-fd7bc85b1857.gif">
</td>
<td>
<img src="https://user-images.githubusercontent.com/36935426/160475710-2adb0f11-afb6-4860-b1cd-85ccc5421d22.gif">
</td>
</tr>
</table>
### Support
[Support Group](https://t.me/hikka_talks "Telegram").
<b>👨‍👦 NoNick, NoNickUser, NoNickCmd - use another account for userbot</b>
<img src="https://user-images.githubusercontent.com/36935426/158637220-00495363-cf4a-4e6f-a4b2-51d693906ead.png">

View File

@ -195,6 +195,9 @@ class Gallery(InlineUnit):
"force_me": force_me,
}
if isinstance(message, Message):
await (message.edit if message.out else message.respond)("👩‍🎤 <b>Loading inline gallery...</b>")
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"""