forked from Forvad/OfficialBananaBot-Banana-Bot-Autoclaimer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (28 loc) · 1.11 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
import random
from time import sleep
from utils.core.telegram import Accounts
from utils.starter import start, stats
import asyncio
from data.config import WHILE, TIME_WHILE
import os
async def main():
print("Soft's author: https://t.me/ambuscader\n")
action = int(input("Select action:\n1. Start soft\n2. Get statistics\n3. Create sessions\n\n> "))
if not os.path.exists('sessions'):
os.mkdir('sessions')
if not os.path.exists('sessions/accounts.json'):
with open("sessions/accounts.json", 'w') as f:
f.write("[]")
if action == 3:
await Accounts().create_sessions()
if action == 2:
await stats()
if action == 1:
accounts = await Accounts().get_accounts()
tasks = []
for thread, account in enumerate(accounts):
session_name, phone_number, proxy = account.values()
tasks.append(asyncio.create_task(start(session_name=session_name, phone_number=phone_number, thread=thread, proxy=proxy)))
await asyncio.gather(*tasks)
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())