diff --git a/src/autobioebbing.py b/src/autobioebbing.py index 6bb51e4..626d907 100644 --- a/src/autobioebbing.py +++ b/src/autobioebbing.py @@ -310,8 +310,14 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q): insertion_status = '\n'.join(insertion_status) await event.edit(f'{insertion_status}\nreason: {reason}') - @client.on(events.NewMessage(outgoing=True, pattern=r'\.bioebmass$')) + @client.on(events.NewMessage(outgoing=True, pattern=r'\.bioebmass')) async def bioeb_mass(event): + arg = event.text.split(' ', 1) + if len(arg) > 1: + try: + arg = int(arg[1]) + except: + await event.edit('Argument should be integer from 1 to 10') reply = await client.get_messages(event.peer_id, ids=event.reply_to.reply_to_msg_id) when = int(datetime.timestamp(event.date)) t = reply.raw_text @@ -355,7 +361,10 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q): await event.edit(f'trying eat {bioebbing_len} patients...') for patient in bioebbing_ids: await asyncio.sleep(random.uniform(1.234, 4.222)) - await event.respond(f'биоеб {patient}') + if arg: + await event.respond(f'биоеб {arg} {patient}') + else: + await event.respond(f'биоеб {patient}') @client.on(events.NewMessage(outgoing=True, pattern=r'\.biocheck$')) async def set_default_check_chat(event):