-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
98 lines (66 loc) · 2.32 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
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
from utils import *
import random
def get_session(session):
file = open(f'{cwd}/data.json')
data = json.load(file)
sessions = data['sessions']
if session != "": # Remove the current session from the list
sessions.remove(session)
return sessions[0] #picks the first recorded
# return random.choice(sessions)\
def get_sessions():
file = open(f'{cwd}/data.json')
data = json.load(file)
sessions = data['sessions']
return sessions
def run():
"Start The Script"
api_client = TelegramApi()
session = ""
while True:
print("Welcome, Let's get started for the day.")
print("""
Here are the commands;
- Press (1) to add a new account to registry
- Press (2) to send out messages and await response
- Press (3) to exit the application
- Press (4) to check SpamBot
Watch the console closely, as any action would have an identifier here!
""")
response = input(">>")
if response == "1":
api_client.sign_in("")
api_client.add_account()
api_client.stop
print("New Account Added Succcessfully 👍")
elif response == "2":
targetGroup = input("Input your target group invite link? ")
used = 0
all_sessions = get_sessions()
for each in all_sessions:
session = each
print(f"Activating Account {used + 1}")
api_client.sign_in(each)
api_client.client.loop.run_until_complete(
api_client.send_messages(targetGroup, start=used*50)
)
api_client.stop
used += 1
# print("Waiting on response......")
# api_client.run()
print("Text Blast Done")
elif response == "3":
quit()
elif response == "4":
session = get_session(session)
api_client.sign_in(session)
# api_client.add_about()
api_client.client.loop.run_until_complete(
api_client.text_spambot()
)
print("Waiting on response......")
api_client.run()
else:
print("You gave a wrong input. Start all over!")
if __name__ == "__main__":
run()