-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
add_member.py
46 lines (36 loc) · 1.19 KB
/
add_member.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
import asyncio
import json
from itertools import dropwhile
from helper.account_handler import add_member
from init import rs, w, r, banner, clr
clr()
banner()
print(f" {r}Version: {w}3.1 {r}| Author: {w}SAIF ALI{rs}\n")
print(f" {r}Telegram {w}@DearSaif {r}| Instagram: {w}@_Prince.Babu_{rs}\n")
# option for choose username or id
option = input("choose method username or id: ").lower()
async def main():
# loads member
try:
user_id = json.load(open("data/user.json", encoding="utf-8"))
except:
user_id = json.load(open("data/source_user.json", encoding="utf-8"))
# loads users and channel info
config = json.load(open("config.json", encoding="utf-8"))
# list to chcek active member
activelist = [
"UserStatus.RECENTLY",
"UserStatus.LAST_MONTH",
"UserStatus.LAST_WEEK",
"UserStatus.OFFLINE",
"UserStatus.RECENTLY",
"UserStatus.ONLINE",
]
# count retrive old state
last_active = config["from_date_active"]
added = 0
active = []
for x in dropwhile(lambda y: y != last_active, activelist):
active.append(x)
await add_member(user_id, config, active, option)
asyncio.run(main())