Archived
1
0
Fork 0

Update __init__.py

This commit is contained in:
yzhh 2023-10-22 02:22:00 +08:00
parent 964620387c
commit 642817b630

View file

@ -45,6 +45,9 @@ fish_list = {
async def finish_fish(msg: Bot.MessageSession): async def finish_fish(msg: Bot.MessageSession):
play_state[msg.target.target_id]['active'] = False play_state[msg.target.target_id]['active'] = False
if msg.target.target_from != 'TEST|Console':
qc = CoolDown('fish', msg)
qc.reset()
if play_state[msg.target.target_id]['hooked']: if play_state[msg.target.target_id]['hooked']:
fish_name_key = 'fish.message.type.' + play_state[msg.target.target_id]['fish_name'] fish_name_key = 'fish.message.type.' + play_state[msg.target.target_id]['fish_name']
fish_name = msg.locale.t(fish_name_key, fallback_failed_prompt=False) fish_name = msg.locale.t(fish_name_key, fallback_failed_prompt=False)
@ -62,14 +65,12 @@ async def finish_fish(msg: Bot.MessageSession):
await msg.finish(text) await msg.finish(text)
else: else:
await msg.finish('你收回了鱼竿,什么都没有钓到。', quote=False) await msg.finish('你收回了鱼竿,什么都没有钓到。', quote=False)
if msg.target.target_from != 'TEST|Console':
qc = CoolDown('stone', msg)
qc.reset()
@fish.command('{{fish.help}}') @fish.command('{{fish.help}}')
async def fish(msg: Bot.MessageSession): async def fish(msg: Bot.MessageSession):
qc = CoolDown('stone', msg) if msg.target.target_from != 'TEST|Console':
qc = CoolDown('fish', msg)
c = qc.check(60) c = qc.check(60)
if c != 0: if c != 0:
await msg.finish(msg.locale.t('message.cooldown', time=int(c), cd_time='60')) await msg.finish(msg.locale.t('message.cooldown', time=int(c), cd_time='60'))