Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

勋章0-20用户跳过满级20级的即将过期礼物投喂。 #413

Open
Lv6-MisakaMikoto opened this issue Jul 29, 2020 · 2 comments
Open

Comments

@Lv6-MisakaMikoto
Copy link

对过期礼物是否优先投递到其他勋章(按照勋章等级由大到小顺序投递),之后会剩余的清理掉至clean-expiring-gift2room

clean_expiring_gift2all_medal = false
clean-expiring-gift2room = 0
20级时的亲密度1500似乎没有任何用处了。或者只投喂1颗心保持牌子不被熄灭?(自己手动投喂一个也不是很麻烦)

@yjqiang
Copy link
Owner

yjqiang commented Jul 31, 2020

async def send_expiring_gift(user, gift_intimacy: dict):
if not user.task_ctrl['clean-expiring-gift']:
return
gift_bags = await SendGiftTask.fetch_giftbags(user)
room_id = user.task_ctrl['clean-expiring-gift2room']
time_set = user.task_ctrl['set-expiring-time']
# filter 用过期来过滤
expiring_giftbags = []
for gift in gift_bags:
left_time = gift[3]
if left_time is not None and 0 < int(left_time) < time_set:
expiring_giftbags.append(gift[:3])
if expiring_giftbags:
print('发现即将过期的礼物')
if user.task_ctrl['clean_expiring_gift2all_medal']:
print('正在清理过期礼物到用户勋章')
medals = await UtilsTask.fetch_medals(user)
expiring_giftbags = await SendGiftTask.fill_intimacy(user, expiring_giftbags, medals, gift_intimacy)
print('正在清理过期礼物到指定房间')
for gift_id, gift_num, bag_id in expiring_giftbags:
await UtilsTask.send_gift(user, room_id, gift_num, bag_id, gift_id)
else:
print('未发现即将过期的礼物')

先投递其他勋章,后清理到 clean-expiring-gift2room
看不太懂你的意思

@pjy612
Copy link
Contributor

pjy612 commented Jul 31, 2020

估计是想说20以上的 不自动送礼物,20以上都要氪金,普通礼物除了小心心点亮外送了浪费。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants