-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathemojis.py
40 lines (38 loc) · 1.03 KB
/
emojis.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
"""Emoji
Available Commands:
.emoji shrug
.emoji apple
.emoji :/
.emoji -_-"""
from telethon import events
import asyncio
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="emoji (.*)"))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.3
animation_ttl = range(0, 16)
input_str = event.pattern_match.group(1)
if input_str == "shrug":
await event.edit("¯\_(ツ)_/¯")
elif input_str == "apple":
await event.edit("\uF8FF")
elif input_str == ":/":
await event.edit(input_str)
animation_chars = [
":\\",
":/"
]
for i in animation_ttl:
await asyncio.sleep(animation_interval)
await event.edit(animation_chars[i % 2])
elif input_str == "-_-":
await event.edit(input_str)
animation_chars = [
"-__-",
"-_-"
]
for i in animation_ttl:
await asyncio.sleep(animation_interval)
await event.edit(animation_chars[i % 2])