-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathReactions.py
120 lines (92 loc) ยท 2.95 KB
/
Reactions.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
110
111
112
113
114
115
116
117
118
119
120
# .------.------.------.------.------.------.------.------.------.------.
# |D.--. |4.--. |N.--. |1.--. |3.--. |L.--. |3.--. |K.--. |0.--. |0.--. |
# | :/\: | :/\: | :(): | :/\: | :(): | :/\: | :(): | :/\: | :/\: | :/\: |
# | (__) | :\/: | ()() | (__) | ()() | (__) | ()() | :\/: | :\/: | :\/: |
# | '--'D| '--'4| '--'N| '--'1| '--'3| '--'L| '--'3| '--'K| '--'0| '--'0|
# `------`------`------`------`------`------`------`------`------`------'
#
# Copyright 2023 t.me/D4n13l3k00
# Licensed under the Creative Commons CC BY-NC-ND 4.0
#
# Full license text can be found at:
# https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode
#
# Human-friendly one:
# https://creativecommons.org/licenses/by-nc-nd/4.0
# meta developer: @D4n13l3k00
import contextlib
from random import choice
from telethon import functions
from .. import loader # type: ignore
@loader.tds
class ReactionsMod(loader.Module):
"Telegram reactions"
strings = {"name": __doc__}
async def client_ready(self, client, _):
self.client = client
def reaction(func):
async def wrapper(self, *args):
"<reply>"
message = args[0]
emoji = await func(self)
if reply := await message.get_reply_message():
with contextlib.suppress(Exception):
await self.client(
functions.messages.SendReactionRequest(
reply.peer_id, reply.id, reaction=emoji
)
)
if message.out:
await message.delete()
return wrapper
@reaction
async def randrcmd(self):
return choice("๐๐โค๏ธ๐ฅ๐๐คฉ๐ฑ๐๐ข๐ฉ๐คฎ๐ฅฐ๐คฏ๐ค๐คฌ๐")
@reaction
async def lovecmd(self):
return "โค"
@reaction
async def sadcmd(self):
return "๐ข"
@reaction
async def nastycmd(self):
return "๐คฎ"
@reaction
async def cutecmd(self):
return "๐ฅฐ"
@reaction
async def clapcmd(self):
return "๐"
@reaction
async def fuckcmd(self):
return "๐คฌ"
@reaction
async def wtfcmd(self):
return "๐คฏ"
@reaction
async def hmmcmd(self):
return "๐ค"
@reaction
async def hooraycmd(self):
return "๐"
@reaction
async def likecmd(self):
return "๐"
@reaction
async def dislikecmd(self):
return "๐"
@reaction
async def firecmd(self):
return "๐ฅ"
@reaction
async def omgcmd(self):
return "๐ฑ"
@reaction
async def wowcmd(self):
return "๐คฉ"
@reaction
async def hehecmd(self):
return "๐"
@reaction
async def shitcmd(self):
return "๐ฉ"