Add files via upload
This commit is contained in:
parent
331dabd88d
commit
4c1327413e
1 changed files with 34 additions and 0 deletions
|
@ -291,6 +291,40 @@ async def cmd_myzh (message: types.Message):
|
||||||
print(f"localhost SELECT:{Err}")
|
print(f"localhost SELECT:{Err}")
|
||||||
await message.answer(msg, parse_mode=types.ParseMode.HTML)
|
await message.answer(msg, parse_mode=types.ParseMode.HTML)
|
||||||
|
|
||||||
|
@dp.message_handler(commands=['ends'])
|
||||||
|
async def cmd_ends (message: types.Message):
|
||||||
|
msg="🤷"
|
||||||
|
user_id = int(message.from_user.id)
|
||||||
|
user_fn = message.from_user.first_name or ''
|
||||||
|
lng_code = message.from_user.language_code or ''
|
||||||
|
when_int = int(datetime.timestamp(message.date))
|
||||||
|
rd=int(await reg_user(message))#create or date
|
||||||
|
if db_pymysql:
|
||||||
|
try:
|
||||||
|
#зберігалка: https://github.com/S1S13AF7/ub4tg (адреса може змінитись)
|
||||||
|
dbc.execute(f"SELECT user_id,bio_str,expr_str FROM `tg_iris_zarazy` WHERE who_id = {user_id} AND expr_int < {when_int} ORDER BY `bio_int` DESC LIMIT 10;")# % int(user_id),int(when_int));
|
||||||
|
bz_info = dbc.fetchmany(10)#получить
|
||||||
|
all_sicknes=[]#інфа
|
||||||
|
count=len(bz_info)
|
||||||
|
who=f"🦠 {user_fn}:"
|
||||||
|
for row in bz_info:
|
||||||
|
print(row)
|
||||||
|
id_user=row["user_id"]
|
||||||
|
bio_str=row["bio_str"]
|
||||||
|
u_link =f'tg://openmessage?user_id={id_user}' #fix для любителів мінять його
|
||||||
|
expr_str=re.sub(r'.20', r'.',row["expr_str"]) #.2024->.24
|
||||||
|
a_href = f'<a href="{u_link}"><code>@{id_user}</code></a>'
|
||||||
|
all_sicknes.append(f"➕{bio_str} {a_href}#{expr_str}\n")
|
||||||
|
if len(all_sicknes)!=0:
|
||||||
|
all_sicknes=f'{who}\n{"".join(all_sicknes)}'
|
||||||
|
else:
|
||||||
|
all_sicknes='🤷 інфа нема.'
|
||||||
|
msg=all_sicknes
|
||||||
|
except Exception as Err:
|
||||||
|
msg = Err
|
||||||
|
print(f"localhost SELECT:{Err}")
|
||||||
|
await message.answer(msg, parse_mode=types.ParseMode.HTML)
|
||||||
|
|
||||||
@dp.message_handler(commands=['help'])
|
@dp.message_handler(commands=['help'])
|
||||||
async def process_help_command(message: types.Message):
|
async def process_help_command(message: types.Message):
|
||||||
#await message.answer(emoji="🤷")
|
#await message.answer(emoji="🤷")
|
||||||
|
|
Loading…
Reference in a new issue