reformat and fix
This commit is contained in:
parent
d945c3247f
commit
ece17d6bd3
1 changed files with 26 additions and 28 deletions
|
@ -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 event.reply_to:
|
||||||
if m.sender_id == 6333102398:
|
reply = await client.get_messages(event.peer_id, ids=event.reply_to.reply_to_msg_id)
|
||||||
if event.reply_to:
|
t = reply.raw_text
|
||||||
reply = await client.get_messages(event.peer_id, ids=event.reply_to.reply_to_msg_id)
|
if reply.entities:
|
||||||
t= reply.raw_text
|
t = utils.sanitize_parse_mode('html').unparse(t, reply.entities)
|
||||||
if reply.entities:
|
r = re.findall(r'([0-9]{6,10})', t)
|
||||||
t=utils.sanitize_parse_mode('html').unparse(t,reply.entities)
|
if r:
|
||||||
r= re.findall(r'([0-9]{6,10})',t)
|
id = int(r[0])
|
||||||
if r:
|
if config.db_pymysql:
|
||||||
id=int(r[0])
|
try:
|
||||||
if db_pymysql:
|
con.query(f"DELETE FROM `tg_bio_attack` WHERE `user_id` = {id};")
|
||||||
try:
|
except:
|
||||||
con.query(f"DELETE FROM `tg_bio_attack` WHERE `user_id` = {id};");
|
pass
|
||||||
except:
|
try:
|
||||||
pass
|
con.query(f"DELETE FROM `tg_bio_users` WHERE `user_id` = {id};")
|
||||||
try:
|
except:
|
||||||
con.query(f"DELETE FROM `tg_bio_users` WHERE `user_id` = {id};"); #
|
pass
|
||||||
except:
|
if config.db_sqlite3:
|
||||||
pass
|
try:
|
||||||
if db_sqlite3:
|
c.execute("DELETE FROM avocado WHERE user_id = %d" % int(id))
|
||||||
try:
|
conn.commit() # rm 404 id
|
||||||
c.execute("DELETE FROM avocado WHERE user_id = %d" % int(id));
|
except Exception as Err:
|
||||||
conn.commit() # rm 404 id
|
logger.exception(f'err: {Err} in DELETE FROM avocado WHERE `user_id` = {id}')
|
||||||
except Exception as Err:
|
|
||||||
print(f'err: {Err} in DELETE FROM avocado WHERE `user_id` = {id}')
|
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue