-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (32 loc) · 1.73 KB
/
main.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
from pyrogram import Client, filters
import requests
import random
api_id = 25961801 # Api Id here
api_hash = 'c9d39e5cba88255416aad52f0d0e1cd8' # Api Hash Here
token = '7022972115:AAGimUJWfGzQa4ReKGbDyP3c0OuqcZqC1Og' #Bot Token Here.
emojis = ["👍", "👎", "❤️", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤🔥", "🌚", "🌭", "💯", "🤣", "⚡️", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍️", "🤗", "🫡", "🎅", "🎄", "☃️", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷♂", "🤷", "🤷♀", "😡"]
app = Client("my_bot", api_id=api_id, api_hash=api_hash, bot_token=token)
@app.on_message()
async def react_to_message(client, message):
chat_id = message.chat.id
message_id = message.id
# Choose a random emoji from the list
random_emoji = random.choice(emojis)
url = f'https://api.telegram.org/bot{token}/setMessageReaction'
# Parameters for the request
params = {
'chat_id': chat_id,
'message_id': message_id,
'reaction': [{
"type": "emoji",
"emoji": random_emoji
}]
}
response = requests.post(url, json=params)
if response.status_code == 200:
print("Reaction set successfully!")
print("Response content:", response.content)
else:
print(f"Failed to set reaction. Status code: {response.status_code}")
print("Response content:", response.content)
app.run()