[fix] vip IndexError

This commit is contained in:
xtaodada 2021-12-24 22:52:54 +08:00
parent 02281473a7
commit 7a1908b7f1
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 5 additions and 5 deletions

View File

@ -322,7 +322,7 @@
},
{
"name": "vip",
"version": "0.712",
"version": "0.713",
"section": "chat",
"maintainer": "xtaodada",
"size": "11.6 kb",

8
vip.py
View File

@ -137,7 +137,7 @@ async def pixiv(context):
except ValueError:
await context.edit('镜像源序号错误。')
return
if 0 < num < 4:
if 0 < num < 3:
try:
redis.set("pixiv_num", num)
except ConnectionError:
@ -151,14 +151,14 @@ async def pixiv(context):
else:
pass
if not redis_status():
num = 3
num = 2
else:
try:
num = int(redis.get("pixiv_num").decode())
except AttributeError:
num = 3
num = 2
except ConnectionError:
num = 3
num = 2
try:
message = await obtain_message(context)
except ValueError: