-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathweebify.py
40 lines (29 loc) · 1.3 KB
/
weebify.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from typing import List
from telegram import Bot, Update
from telegram.ext import run_async
from tg_bot import dispatcher
from tg_bot.modules.disable import DisableAbleCommandHandler
normiefont = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z']
weebyfont = ['卂', '乃', '匚', '刀', '乇', '下', '厶', '卄', '工', '丁', '长', '乚', '从', '𠘨', '口', '尸', '㔿', '尺', '丂', '丅', '凵',
'リ', '山', '乂', '丫', '乙']
@run_async
def weebify(bot: Bot, update: Update, args: List[str]):
string = ' '.join(args).lower()
for normiecharacter in string:
if normiecharacter in normiefont:
weebycharacter = weebyfont[normiefont.index(normiecharacter)]
string = string.replace(normiecharacter, weebycharacter)
message = update.effective_message
if message.reply_to_message:
message.reply_to_message.reply_text(string)
else:
message.reply_text(string)
__help__ = """
- /weebify <text>: returns a weebified text
"""
WEEBIFY_HANDLER = DisableAbleCommandHandler("weebify", weebify, pass_args=True)
dispatcher.add_handler(WEEBIFY_HANDLER)
__mod_name__ = "WEEBIFY"
__command_list__ = ["weebify"]
__handlers__ = [WEEBIFY_HANDLER]