try be more smarter autobioeb intervals
This commit is contained in:
parent
b828b0812f
commit
88d3299333
1 changed files with 10 additions and 1 deletions
|
@ -150,7 +150,10 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q):
|
|||
pathogen_remaining = int(re.findall(
|
||||
bio_attack_theme[3], t)[0])
|
||||
if pathogen_remaining <= states.auto_bioeb_pathogen_threshold and u1id == my_id:
|
||||
states.auto_bioeb_sleep_interval = states.auto_bioeb_max_interval
|
||||
if pathogen_remaining == 0:
|
||||
states.auto_bioeb_sleep_interval = (60 * states.auto_bioeb_pathogen_threshold, 61 * states.auto_bioeb_pathogen_threshold)
|
||||
else:
|
||||
states.auto_bioeb_sleep_interval = states.auto_bioeb_max_interval
|
||||
logger.warning(
|
||||
f'Interval bioeb changed (slow down): {states.auto_bioeb_sleep_interval}')
|
||||
elif u1id == my_id:
|
||||
|
@ -501,5 +504,11 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q):
|
|||
except Exception as Err:
|
||||
logger.exception(f'err: {Err} in DELETE FROM avocado WHERE `user_id` = {id}')
|
||||
|
||||
@client.on(events.NewMessage(pattern='👺 Чекай нових', from_users=(avocado_id,)))
|
||||
async def pathogen_end(event):
|
||||
if event.mentioned:
|
||||
states.auto_bioeb_sleep_interval = tuple([x * 2 for x in states.auto_bioeb_max_interval])
|
||||
logger.warning(f'Autobieb inverval slow dowm, {states.auto_bioeb_sleep_interval}, because pathogens <= 0...')
|
||||
|
||||
####################################################################
|
||||
|
||||
|
|
Loading…
Reference in a new issue