-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
39 lines (31 loc) · 1.18 KB
/
Copy pathtasks.py
File metadata and controls
39 lines (31 loc) · 1.18 KB
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
import asyncio
from logs import logger
from config import retry_for_errors
async def start_task(client, userInfo):
for i in range(retry_for_errors):
try:
rewardPoint = userInfo["data"]["rewardPoint"]
tasks_list = {
"twitter_x_id_points": {
"name": "twitter",
"taskId": "twitter_x_id"
},
"discordid_points": {
"name": "discord",
"taskId": "discordid"
},
"telegramid_points": {
"name": "telegram",
"taskId": "telegramid"
}
}
for taskKey, taskInfo in tasks_list.items():
if rewardPoint[taskKey] == 0:
task = await client.task(taskInfo["taskId"])
if "status" in task and task["status"]:
logger.success(f"{client.account.name} task ready {taskInfo['name']}")
await asyncio.sleep(3)
break
except Exception as err:
logger.error(f"{client.account.name} {err}")
await asyncio.sleep(10)