Skip to content

Commit

Permalink
下载范围增加区间模式("|1|99"表示下载1<id<99的消息)
Browse files Browse the repository at this point in the history
  • Loading branch information
holll committed Oct 25, 2022
1 parent cdd44da commit ca1de22
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ async def upDate_dialogs():


def can_continue(_id, plus_func):
need_id = int(plus_func[1:])
need_id = 0
if plus_func[0] != '|':
need_id = int(plus_func[1:])
if plus_func[0] == '=':
if need_id > _id:
return 2
Expand All @@ -152,6 +154,19 @@ def can_continue(_id, plus_func):
return 0
else:
return 1
elif plus_func[0] == '|':
tmpId = plus_func[1:].split('|')
a_id = int(tmpId[0])
b_id = int(tmpId[-1])
if a_id >= b_id:
print('消息id范围错误')
return 2
if _id > tmpId[-1]:
return 1
elif _id < tmpId[0]:
return 2
else:
return 0
else:
return 2

Expand Down

0 comments on commit ca1de22

Please sign in to comment.