-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd_member.py
26 lines (21 loc) · 900 Bytes
/
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
import asyncio
import json
from itertools import dropwhile
from helper.helpfun import add_mem
#option for choose username or id
option = input('choose method username or id: ').lower()
async def main():
#loads member
user_id = (json.load(open("data/user.json")))
#loads users and channel info
config = (json.load(open("config.json")))
#list to chcek active member
activelist = ['UserStatus.LONG_AGO', '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_mem(user_id, config, active, option)
asyncio.run(main())