2021-07-09 15:31:30 +00:00
|
|
|
from pyrogram import Client
|
|
|
|
from pyrogram.types import Message
|
|
|
|
from os import getcwd, sep
|
|
|
|
from defs.challenge import get_day
|
2022-03-17 15:44:43 +00:00
|
|
|
from defs.redis_load import redis_status, redis
|
2021-07-09 15:31:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
async def tf_msg(client: Client, message: Message):
|
|
|
|
day = get_day(message)
|
|
|
|
if day == 7:
|
|
|
|
await message.reply('亲爱的旅行者:星期天所有副本都可以刷哦!', quote=True)
|
|
|
|
else:
|
|
|
|
path = f'{getcwd()}{sep}assets{sep}images{sep}tf{day}.png'
|
|
|
|
await message.reply_photo(photo=path, quote=True)
|
|
|
|
|
|
|
|
|
|
|
|
async def wq_msg(client: Client, message: Message):
|
|
|
|
day = get_day(message)
|
|
|
|
if day == 7:
|
|
|
|
await message.reply('亲爱的旅行者:星期天所有副本都可以刷哦!', quote=True)
|
|
|
|
else:
|
|
|
|
path = f'{getcwd()}{sep}assets{sep}images{sep}we{day}.png'
|
|
|
|
await message.reply_photo(photo=path, quote=True)
|
|
|
|
|
|
|
|
|
|
|
|
async def zb_msg(client: Client, message: Message):
|
2022-03-17 15:44:43 +00:00
|
|
|
if redis_status():
|
|
|
|
try:
|
|
|
|
data = redis.get("zb").decode()
|
|
|
|
except AttributeError:
|
|
|
|
data = None
|
|
|
|
if data != "2.5":
|
|
|
|
# 开始上传
|
|
|
|
msg = await message.reply_photo(photo=f"{getcwd()}{sep}assets{sep}images{sep}zb.png", quote=True)
|
|
|
|
# 缓存 file_id
|
|
|
|
redis.set("zb", "2.5")
|
2022-03-17 16:01:09 +00:00
|
|
|
redis.set("zb_file_id", msg.photo.file_id)
|
2022-03-17 15:44:43 +00:00
|
|
|
else:
|
2022-03-17 16:01:09 +00:00
|
|
|
file_id = redis.get("zb_file_id").decode()
|
|
|
|
await message.reply_photo(photo=file_id, quote=True)
|
2022-03-17 15:44:43 +00:00
|
|
|
else:
|
|
|
|
await message.reply_photo(photo=f'{getcwd()}{sep}assets{sep}images{sep}zb.png', quote=True)
|