forked from lc4t/Bili-Live-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanga_daily_job.py
37 lines (29 loc) · 1010 Bytes
/
manga_daily_job.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
from reqs.manga_daily_job import (
MangaSignReq,
ShareComicReq
)
from .base_class import Sched, DontWait, Unique
class MangaSignTask(Sched, DontWait, Unique):
TASK_NAME = 'manga_sign'
@staticmethod
async def check(_):
return (-2, (0, 30)),
@staticmethod
async def work(user):
json_rsp = await user.req_s(MangaSignReq.sign, user)
if not json_rsp['code']:
user.info('漫画每日签到')
else:
user.info(f'漫画每日签到可能重复执行 {json_rsp}')
class ShareComicTask(Sched, DontWait, Unique):
TASK_NAME = 'share_comic'
@staticmethod
async def check(_):
return (-2, (0, 30)),
@staticmethod
async def work(user):
json_rsp = await user.req_s(ShareComicReq.share_comic, user)
if not json_rsp['code']:
user.info('漫画每日分享')
else:
user.info(f'漫画每日分享可能重复执行 {json_rsp}')