reformat and fix

This commit is contained in:
Your Name 2024-12-23 23:56:17 +03:00
parent d945c3247f
commit ece17d6bd3

View file

@ -470,33 +470,31 @@ async def eb(client, c, conn, con, d, get_id, my_id, message_q):
#################################################################### ####################################################################
@client.on(events.NewMessage(pattern='👺 Юзер не знайдений!')) @client.on(events.NewMessage(pattern='👺 Юзер не знайдений!', from_users=(avocado_id,)))
async def avocado_404(event): async def avocado_404(event):
m = event.message
if m.sender_id == 6333102398:
if event.reply_to: if event.reply_to:
reply = await client.get_messages(event.peer_id, ids=event.reply_to.reply_to_msg_id) reply = await client.get_messages(event.peer_id, ids=event.reply_to.reply_to_msg_id)
t= reply.raw_text t = reply.raw_text
if reply.entities: if reply.entities:
t=utils.sanitize_parse_mode('html').unparse(t,reply.entities) t = utils.sanitize_parse_mode('html').unparse(t, reply.entities)
r= re.findall(r'([0-9]{6,10})',t) r = re.findall(r'([0-9]{6,10})', t)
if r: if r:
id=int(r[0]) id = int(r[0])
if db_pymysql: if config.db_pymysql:
try: try:
con.query(f"DELETE FROM `tg_bio_attack` WHERE `user_id` = {id};"); con.query(f"DELETE FROM `tg_bio_attack` WHERE `user_id` = {id};")
except: except:
pass pass
try: try:
con.query(f"DELETE FROM `tg_bio_users` WHERE `user_id` = {id};"); # con.query(f"DELETE FROM `tg_bio_users` WHERE `user_id` = {id};")
except: except:
pass pass
if db_sqlite3: if config.db_sqlite3:
try: try:
c.execute("DELETE FROM avocado WHERE user_id = %d" % int(id)); c.execute("DELETE FROM avocado WHERE user_id = %d" % int(id))
conn.commit() # rm 404 id conn.commit() # rm 404 id
except Exception as Err: except Exception as Err:
print(f'err: {Err} in DELETE FROM avocado WHERE `user_id` = {id}') logger.exception(f'err: {Err} in DELETE FROM avocado WHERE `user_id` = {id}')
#################################################################### ####################################################################