-
Notifications
You must be signed in to change notification settings - Fork 0
/
t.py
31 lines (26 loc) · 882 Bytes
/
t.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
from telethon import TelegramClient
import time
from telethon.sessions import StringSession
from config import (API_ID, API_HASH, SESSION_STRING, CHAT_ID)
client = TelegramClient(StringSession(SESSION_STRING), API_ID, API_HASH)
nnn = 1
async def main():
iii = 1000
async for message in client.iter_messages(CHAT_ID):
if 'MessageActionChatAddUser' in str(message.action):
await client.delete_messages(CHAT_ID, message.id)
iii -= 1
if iii == 0:
break
with client:
while True:
client.loop.run_until_complete(main())
print(nnn, ' ')
nnn += 1
tim = time.localtime()
current_time = time.strftime("%H", tim)
if current_time == 1:
time.sleep(21600)
print(nnn, ' SLEEPING 6 hours. Economy DynoHours. ')
else:
time.sleep(60)