-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathemojify.py
77 lines (71 loc) · 2.1 KB
/
emojify.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
"""
Created by @Jisan7509
modified by @mrconfused
Userbot plugin for CatUserbot
"""
from userbot import catub
from userbot.core.managers import edit_or_reply
from userbot.helpers import fonts as emojify
plugin_category = "fun"
@catub.cat_cmd(
pattern="emoji(?:\s|$)([\s\S]*)",
command=("emoji", plugin_category),
info={
"header": "Converts your text to big emoji text, with some default emojis.",
"usage": "{tr}emoji <text>",
"examples": ["{tr}emoji catuserbot"],
},
)
async def itachi(event):
"To get emoji art text."
args = event.pattern_match.group(1)
get = await event.get_reply_message()
if not args and get:
args = get.text
if not args:
await edit_or_reply(
event, "__What am I Supposed to do with this idiot, Give me a text.__"
)
return
result = ""
for a in args:
a = a.lower()
if a in emojify.kakashitext:
char = emojify.kakashiemoji[emojify.kakashitext.index(a)]
result += char
else:
result += a
await edit_or_reply(event, result)
@catub.cat_cmd(
pattern="cmoji(?:\s|$)([\s\S]*)",
command=("cmoji", plugin_category),
info={
"header": "Converts your text to big emoji text, with your custom emoji.",
"usage": "{tr}cmoji <emoji> <text>",
"examples": ["{tr}cmoji 😺 catuserbot"],
},
)
async def itachi(event):
"To get custom emoji art text."
args = event.pattern_match.group(1)
get = await event.get_reply_message()
if not args and get:
args = get.text
if not args:
return await edit_or_reply(
event, "__What am I Supposed to do with this idiot, Give me a text.__"
)
try:
emoji, arg = args.split(" ", 1)
except Exception:
arg = args
emoji = "😺"
result = ""
for a in arg:
a = a.lower()
if a in emojify.kakashitext:
char = emojify.itachiemoji[emojify.kakashitext.index(a)].format(cj=emoji)
result += char
else:
result += a
await edit_or_reply(event, result)