forked from hikariatama/ftg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrashguy.py
executable file
·82 lines (71 loc) · 2.32 KB
/
trashguy.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
# █ █ ▀ █▄▀ ▄▀█ █▀█ ▀
# █▀█ █ █ █ █▀█ █▀▄ █
# © Copyright 2022
# https://t.me/hikariatama
#
# 🔒 Licensed under the GNU AGPLv3
# 🌐 https://www.gnu.org/licenses/agpl-3.0.html
# meta pic: https://static.hikari.gay/trashguy_icon.png
# meta banner: https://mods.hikariatama.ru/badges/trashguy.jpg
# meta developer: @hikarimods
# scope: inline
# scope: hikka_only
# scope: hikka_min 1.2.10
import grapheme
from telethon.tl.types import Message
from .. import loader, utils
def trashguy(text: str) -> list:
DISTANCE = 5
SPACER = "\u0020\u2800"
text = list(grapheme.graphemes(text))
return [
utils.escape_html(i)
for i in utils.array_sum(
[
[
f"🗑{SPACER * i}(>"
f" ^_^)>{SPACER * (DISTANCE - i)}{''.join(text[offset:])}"
for i in range(DISTANCE)
]
+ [
f"🗑{SPACER * (DISTANCE - i)}{current_symbol}<(^_^"
f" <){SPACER * i}{''.join(text[offset + 1:])}"
for i in range(DISTANCE)
]
for offset, current_symbol in enumerate(text)
]
)
]
@loader.tds
class TrashGuyMod(loader.Module):
"""Animation of trashguy taking out the trash"""
strings = {
"name": "TrashGuy",
"done": (
"🗑 \\ (•◡•) /"
" 🗑\n\u0020\u2800\u0020\u2800<b>Done!</b>\u0020\u2800\u0020\u2800"
),
}
strings_ru = {
"done": (
"🗑 \\ (•◡•) / 🗑\n\u0020\u2800\u0020\u2800<b>Я"
" закончил!</b>\u0020\u2800\u0020\u2800"
),
}
async def tguyicmd(self, message: Message):
"""<text> - TrashGuy Inline"""
await self.animate(
message,
trashguy(utils.get_args_raw(message) or "hikari's brain")
+ [self.strings("done")],
interval=1,
inline=True,
)
async def tguycmd(self, message: Message):
"""<text> - TrashGuy"""
await self.animate(
message,
trashguy(utils.get_args_raw(message) or "hikari's brain")
+ [self.strings("done")],
interval=1,
)