Minor bugfixes

- Make uvloop optional
- Fix `utils.escape_html`
- Add nickname check when creating bot (less than 64)
- Add banner in `.info`
pull/1/head
hikariatama 2022-05-16 05:37:58 +00:00
parent 0337c97a1f
commit 8f5e879dc4
6 changed files with 13 additions and 9 deletions

View File

@ -55,7 +55,7 @@ class TokenObtainment(InlineUnit):
username = f"@hikka_{uid}_bot"
for msg in [
f"🌘 Hikka Userbot of {self._name}",
f"🌘 Hikka Userbot of {self._name}"[:64],
username,
"/setuserpic",
username,

View File

@ -41,7 +41,6 @@ import sqlite3
import sys
from math import ceil
from typing import Union
import uvloop
import subprocess
from telethon import TelegramClient, events
@ -80,7 +79,11 @@ DATA_DIR = (
CONFIG_PATH = os.path.join(DATA_DIR, "config.json")
uvloop.install()
try:
import uvloop
uvloop.install()
except Exception:
pass
def run_config(

View File

@ -136,6 +136,7 @@ class HikkaInfoMod(loader.Module):
"text": self.config["custom_button"].split("|")[0],
"url": self.config["custom_button"].split("|")[1],
},
photo="https://i.imgur.com/qW1j9U6.jpeg",
)
@loader.unrestricted
@ -149,7 +150,7 @@ class HikkaInfoMod(loader.Module):
(
"🌘 <b>Hikka</b>\n\n"
"Brand new userbot for Telegram with a lot of features, "
"aka InlineGalleries, Forms and others. Userbot - software, running "
"aka InlineGalleries, forms etc. Userbot - software, running "
"on your Telegram account. If you write a command to any chat, it will "
"get executed right there. Check out live examples at "
'<a href="https://github.com/hikariatama/Hikka">GitHub</a>'
@ -158,7 +159,7 @@ class HikkaInfoMod(loader.Module):
else (
"🌘 <b>Hikka</b>\n\n"
"Новый юзербот для Telegram с огромным количеством функций, "
"из которых: Инлайн Галереи, формы и другое. Юзербот - программа, "
"из которых: Инлайн галереи, формы и другое. Юзербот - программа, "
"которая запускается на твоем Telegram-аккаунте. Когда ты пишешь "
"команду в любом чате, она сразу же выполняется. Обрати внимание "
'на живые примеры на <a href="https://github.com/hikariatama/Hikka">GitHub</a>'

View File

@ -167,9 +167,9 @@ def get_entity_id(entity: Entity) -> int:
return telethon.utils.get_peer_id(entity)
def escape_html(text: str, /) -> str:
def escape_html(text: str, /) -> str: # sourcery skip
"""Pass all untrusted/potentially corrupt input here"""
return text.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
return str(text).replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
def escape_quotes(text: str, /) -> str:

View File

@ -4,4 +4,5 @@ emoji
moviepy
python-ffmpeg
ffmpeg
bs4
bs4
uvloop

View File

@ -9,6 +9,5 @@ requests==2.27.1
aiogram==2.19
websockets==10.2
grapheme==0.6.0
uvloop==0.16.0
# Python 3.8+