# █ █ ▀ █▄▀ ▄▀█ █▀█ ▀
# █▀█ █ █ █ █▀█ █▀▄ █
# © Copyright 2022
# https://t.me/hikariatama
#
# 🔒 Licensed under the GNU GPLv3
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
# meta pic: https://img.icons8.com/plasticine/344/hiragana-ma.png
# meta developer: @hikarimods
# meta banner: https://mods.hikariatama.ru/badges/alphabet.jpg
# scope: hikka_only
# scope: hikka_min 1.4.0
import logging
from telethon.tl.types import Message
from .. import loader, utils
logger = logging.getLogger(__name__)
to_ = [
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
'😀',
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"🔤",
"1️⃣",
"2️⃣",
"3️⃣",
"4️⃣",
"5️⃣",
"6️⃣",
"7️⃣",
"8️⃣",
"9️⃣",
"0️⃣",
'📝',
'📝',
'⭕️',
'🛑',
'❗️',
'❓',
'📛',
]
from_ = (
"абвгдеёжзийклмнопрстуфхцчшщъыьэюяАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890().,!? "
)
@loader.tds
class Alphabet(loader.Module):
"""Replaces your text with custom emojis. Telegram Premium only"""
strings = {
"name": "Alphabet",
"no_text": "🚫 Specify text to replace",
"premium_only": (
"⭐️ This module is available only to Telegram Premium subscribers"
),
}
strings_ru = {
"no_text": "🚫 Укажите текст для замены",
"premium_only": "⭐️ Этот модуль доступен только для Telegram Premium",
"_cmd_doc_a": "Заменить текст на эмодзи",
"_cls_doc": "Заменяет текст на кастомные эмодзи. Только для Telegram Premium",
}
strings_de = {
"no_text": "🚫 Gib den Text ein, der ersetzt werden soll",
"premium_only": (
"⭐️ Dieses Modul ist nur für Telegram Premium-Abonnenten verfügbar"
),
"_cmd_doc_a": "Ersetze Text durch Emojis",
"_cls_doc": (
"Ersetzt Text durch benutzerdefinierte Emojis. Nur für Telegram Premium"
),
}
strings_hi = {
"no_text": "🚫 बदलने के लिए पाठ निर्दिष्ट करें",
"premium_only": "⭐️ यह मॉड्यूल केवल Telegram Premium सदस्यों के लिए उपलब्ध है",
"_cmd_doc_a": "पाठ को इमोजी के रूप में बदलें",
"_cls_doc": "आपके पाठ को कस्टम इमोजी के रूप में बदलता है। केवल Telegram Premium के लिए",
}
strings_uz = {
"no_text": "🚫 Almashtirish uchun matn belgilang",
"premium_only": (
"⭐️ Bu modul faqat Telegram Premium obuna bo'lganlar uchun mavjud"
),
"_cmd_doc_a": "Matnni emoji bilan almashtiring",
"_cls_doc": (
"Matnni sizning emojiingiz bilan almashtiradi. Faqat Telegram Premium uchun"
),
}
async def client_ready(self):
if not (await self._client.get_me()).premium:
raise loader.LoadError(self.strings("premium_only"))
self._from = from_
self._to = to_
async def acmd(self, message: Message):
""" - Write text with emojis"""
args = utils.get_args_raw(message)
reply = await message.get_reply_message()
if not args and not reply:
await utils.answer(message, self.strings("no_text"))
return
await utils.answer(
message,
"".join(
to_[from_.index(char)] if char in from_ else char
for char in args or reply.raw_text
),
)