-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbl.py
41 lines (31 loc) · 1.06 KB
/
bl.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
import time
import traceback
import settings
client = 0
def send_message() :
members = client.get_participants(settings.SOURCE_GROUP)
for member in members :
print(member.id)
time.sleep(settings.WAIT_TIME)
if settings.CONTENT_TYPE=="text" :
client.send_message(member.id, settings.CONTENT)
elif settings.CONTENT_TYPE=="file" :
client.send_file(member.id, settings.CONTENT)
def add_people() :
members = client.get_participants(settings.SOURCE_GROUP)
for member in members :
print(member.id)
time.sleep(settings.WAIT_TIME)
try:
client(AddChatUserRequest(settings.TARGET_GROUP, member.id,fwd_limit=10 ))
print("added successfully")
except:
print("exception accured when adding user-> AddChatUserRequest")
traceback.print_exc()
def doAction(telegClient) :
global client
client = telegClient
if settings.ACTION == "message" :
send_message()
elif settings.ACTION == "add" :
add_people()