mirror of https://github.com/coddrago/Heroku
Fix tags error in aiogram
parent
99f834e4dd
commit
8b04707353
|
@ -122,7 +122,7 @@ class Form(InlineUnit):
|
||||||
logger.error("Invalid type for `text`")
|
logger.error("Invalid type for `text`")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
text = self._sanitise_text(text)
|
text = self.sanitise_text(text)
|
||||||
|
|
||||||
if not isinstance(silent, bool):
|
if not isinstance(silent, bool):
|
||||||
logger.error("Invalid type for `silent`")
|
logger.error("Invalid type for `silent`")
|
||||||
|
|
|
@ -236,9 +236,11 @@ class List(InlineUnit):
|
||||||
try:
|
try:
|
||||||
await self.bot.edit_message_text(
|
await self.bot.edit_message_text(
|
||||||
inline_message_id=call.inline_message_id,
|
inline_message_id=call.inline_message_id,
|
||||||
text=self._units[unit_id]["strings"][
|
text=self.sanitise_text(
|
||||||
self._units[unit_id]["current_index"]
|
self._units[unit_id]["strings"][
|
||||||
],
|
self._units[unit_id]["current_index"]
|
||||||
|
]
|
||||||
|
),
|
||||||
reply_markup=self._list_markup(unit_id),
|
reply_markup=self._list_markup(unit_id),
|
||||||
)
|
)
|
||||||
await call.answer()
|
await call.answer()
|
||||||
|
|
|
@ -255,7 +255,7 @@ class Utils(InlineUnit):
|
||||||
|
|
||||||
return reply_markup
|
return reply_markup
|
||||||
|
|
||||||
def _sanitise_text(self, text: str) -> str:
|
def sanitise_text(self, text: str) -> str:
|
||||||
"""Replaces all animated emojis in text with normal ones, bc aiogram doesn't support them"""
|
"""Replaces all animated emojis in text with normal ones, bc aiogram doesn't support them"""
|
||||||
return re.sub(r"</?emoji.*?>", "", text)
|
return re.sub(r"</?emoji.*?>", "", text)
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ class Utils(InlineUnit):
|
||||||
audio = {"url": audio}
|
audio = {"url": audio}
|
||||||
|
|
||||||
if isinstance(text, str):
|
if isinstance(text, str):
|
||||||
text = self._sanitise_text(text)
|
text = self.sanitise_text(text)
|
||||||
|
|
||||||
media_params = [
|
media_params = [
|
||||||
photo is None,
|
photo is None,
|
||||||
|
|
|
@ -74,16 +74,12 @@ class UpdaterMod(loader.Module):
|
||||||
"origin_cfg_doc": "Git origin URL, for where to update from",
|
"origin_cfg_doc": "Git origin URL, for where to update from",
|
||||||
"btn_restart": "🔄 Restart",
|
"btn_restart": "🔄 Restart",
|
||||||
"btn_update": "🧭 Update",
|
"btn_update": "🧭 Update",
|
||||||
"restart_confirm": (
|
"restart_confirm": "❓ <b>Are you sure you want to restart?</b>",
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Are you sure you"
|
|
||||||
" want to restart?</b>"
|
|
||||||
),
|
|
||||||
"secure_boot_confirm": (
|
"secure_boot_confirm": (
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Are you sure you"
|
"❓ <b>Are you sure you want to restart in secure boot mode?</b>"
|
||||||
" want to restart in secure boot mode?</b>"
|
|
||||||
),
|
),
|
||||||
"update_confirm": (
|
"update_confirm": (
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Are you sure you"
|
"❓ <b>Are you sure you"
|
||||||
" want to update?\n\n<a"
|
" want to update?\n\n<a"
|
||||||
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a> ⤑ <a'
|
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a> ⤑ <a'
|
||||||
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a></b>'
|
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a></b>'
|
||||||
|
@ -145,16 +141,13 @@ class UpdaterMod(loader.Module):
|
||||||
"origin_cfg_doc": "Ссылка, из которой будут загружаться обновления",
|
"origin_cfg_doc": "Ссылка, из которой будут загружаться обновления",
|
||||||
"btn_restart": "🔄 Перезагрузиться",
|
"btn_restart": "🔄 Перезагрузиться",
|
||||||
"btn_update": "🧭 Обновиться",
|
"btn_update": "🧭 Обновиться",
|
||||||
"restart_confirm": (
|
"restart_confirm": "❓ <b>Ты уверен, что хочешь перезагрузиться?</b>",
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Ты уверен, что"
|
|
||||||
" хочешь перезагрузиться?</b>"
|
|
||||||
),
|
|
||||||
"secure_boot_confirm": (
|
"secure_boot_confirm": (
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Ты уверен, что"
|
"❓ <b>Ты уверен, что"
|
||||||
" хочешь перезагрузиться в режиме безопасной загрузки?</b>"
|
" хочешь перезагрузиться в режиме безопасной загрузки?</b>"
|
||||||
),
|
),
|
||||||
"update_confirm": (
|
"update_confirm": (
|
||||||
"<emoji document_id='5384612769716774600'>❓</emoji> <b>Ты уверен, что"
|
"❓ <b>Ты уверен, что"
|
||||||
" хочешь обновиться??\n\n<a"
|
" хочешь обновиться??\n\n<a"
|
||||||
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a> ⤑ <a'
|
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a> ⤑ <a'
|
||||||
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a></b>'
|
' href="https://github.com/hikariatama/Hikka/commit/{}">{}</a></b>'
|
||||||
|
@ -566,7 +559,7 @@ class UpdaterMod(loader.Module):
|
||||||
|
|
||||||
await self.inline.bot.edit_message_text(
|
await self.inline.bot.edit_message_text(
|
||||||
inline_message_id=ms,
|
inline_message_id=ms,
|
||||||
text=msg,
|
text=self.inline.sanitise_text(msg),
|
||||||
)
|
)
|
||||||
|
|
||||||
async def full_restart_complete(self, secure_boot: bool = False):
|
async def full_restart_complete(self, secure_boot: bool = False):
|
||||||
|
@ -599,7 +592,7 @@ class UpdaterMod(loader.Module):
|
||||||
|
|
||||||
await self.inline.bot.edit_message_text(
|
await self.inline.bot.edit_message_text(
|
||||||
inline_message_id=ms,
|
inline_message_id=ms,
|
||||||
text=msg,
|
text=self.inline.sanitise_text(msg),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue