-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEasyEarchMoney.py
43 lines (37 loc) · 1.26 KB
/
EasyEarchMoney.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 telethon.tl.functions.messages import GetBotCallbackAnswerRequest
from telethon import TelegramClient, events, sync
import time
import random
import asyncio
api_id = 1113563
api_hash = '1f7121137341cf01592a5e0079d665ac'
client = TelegramClient('EasyEarchMoney', api_id, api_hash)
client.start()
dlgs = client.get_dialogs()
def AlfaprofitViews():
for dlg in dlgs:
if dlg.title == 'ALPHAPROFIT | VIEWS':
AlphaViews = dlg
msgs = client.get_messages(AlphaViews, limit = 30)
for msg in msgs:
time.sleep(random.uniform(0, 2))
def get_id_data():
global button_data
global message_id
if msg.reply_markup is not None:
button_data = msg.reply_markup.rows[0].buttons[0].data
message_id = msg.id
print(button_data, message_id)
try:
get_id_data()
except:
print('KeyboardButtonUrl Error')
resp = client(GetBotCallbackAnswerRequest(
AlphaViews, # dialog
message_id,
data = button_data
))
AlfaprofitViews()
@client.on(events.NewMessage(chats=('ALPHAPROFIT | VIEWS')))
async def normal_handler(event):
AlfaprofitViews()