-
Notifications
You must be signed in to change notification settings - Fork 22
/
fliptext.py
109 lines (103 loc) · 1.8 KB
/
fliptext.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import asyncio
from pyrogram import Client, filters
from pyrogram.raw import functions
from pyrogram.types import Message
from utils.misc import modules_help, prefix
from utils.scripts import format_exc
REPLACEMENT_MAP = {
"a": "ɐ",
"b": "q",
"c": "ɔ",
"d": "p",
"e": "ǝ",
"f": "ɟ",
"g": "ƃ",
"h": "ɥ",
"i": "ᴉ",
"j": "ɾ",
"k": "ʞ",
"l": "l",
"m": "ɯ",
"n": "u",
"o": "o",
"p": "d",
"q": "b",
"r": "ɹ",
"s": "s",
"t": "ʇ",
"u": "n",
"v": "ʌ",
"w": "ʍ",
"x": "x",
"y": "ʎ",
"z": "z",
"A": "∀",
"B": "B",
"C": "Ɔ",
"D": "D",
"E": "Ǝ",
"F": "Ⅎ",
"G": "פ",
"H": "H",
"I": "I",
"J": "ſ",
"K": "K",
"L": "˥",
"M": "W",
"N": "N",
"O": "O",
"P": "Ԁ",
"Q": "Q",
"R": "R",
"S": "S",
"T": "┴",
"U": "∩",
"V": "Λ",
"W": "M",
"X": "X",
"Y": "⅄",
"Z": "Z",
"0": "0",
"1": "Ɩ",
"2": "ᄅ",
"3": "Ɛ",
"4": "ㄣ",
"5": "ϛ",
"6": "9",
"7": "ㄥ",
"8": "8",
"9": "6",
",": "'",
".": "˙",
"?": "¿",
"!": "¡",
'"': ",,",
"'": ",",
"(": ")",
")": "(",
"[": "]",
"]": "[",
"{": "}",
"}": "{",
"<": ">",
">": "<",
"&": "⅋",
"_": "‾",
}
@Client.on_message(filters.command("flip", prefix) & filters.me)
async def flip(client: Client, message: Message):
text = " ".join(message.command[1:])
final_str = ""
for char in text:
if char in REPLACEMENT_MAP.keys():
new_char = REPLACEMENT_MAP[char]
else:
new_char = char
final_str += new_char
if text != final_str:
await message.edit(final_str)
else:
await message.edit(text)
modules_help["fliptext"] = {
"flip [amount]*": "flip text upside down"
}