O'zbеkiston respublikasi axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi toshkеnt axborot tеxnologiyalari univеrsitеti


???? Har hafta yoki ???? Bir martalik



Download 86,78 Kb.
bet3/10
Sana18.01.2022
Hajmi86,78 Kb.
#390472
1   2   3   4   5   6   7   8   9   10
Bog'liq
Jurayev A

🗓 Har hafta yoki 🔂 Bir martalik tartibidan foydalaning",

reply_markup=keyboard_l,parse_mode="html")

else:

session = Session()



session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).update(

{Rejim.day: m_text}, synchronize_session=False)

session.commit()

session.close()

keyboard_l = types.InlineKeyboardMarkup()

btn1 = types.InlineKeyboardButton("✅ Ha, vaqtni belgilash", callback_data="yes_time")

btn2 = types.InlineKeyboardButton("🙅‍♂️ Yo\'q, qayta tanlash", callback_data="only_one_date")

keyboard_l.add(btn1)

keyboard_l.add(btn2)

bot.send_message(chat_id, "📌 Xabarnomani har oyning " + m_text + "-sanasiga o'rnatmoqchimisiz? 🧐",

parse_mode="html", reply_markup=keyboard_l)

else:


msg = bot.send_message(chat_id, "📝 1Sanani namunadagi ko\'rinishda kiriting")

bot.register_next_step_handler(msg, data_date_step)

except Exception as e:

msg = bot.send_message(chat_id, "📝 Sanani namunadagi ko\'rinishda kiriting")

bot.send_message(config.admin_id,e)

bot.register_next_step_handler(msg, data_date_step)

def data_sana_step(message):

chat_id = message.chat.id

m_text = message.text

tz = pytz.timezone('Asia/Tashkent')

now = datetime.now(tz)

today_date = str(now.strftime('%d.%m.%Y'))

sana = struct_time(localtime())

try:


if m_text == "🔙Ortga":

keyboard_l = types.InlineKeyboardMarkup()

btn1 = types.InlineKeyboardButton("🗓 Har hafta", callback_data="hafta_kun")

btn2 = types.InlineKeyboardButton("📅 Har oyda", callback_data="only_one_date")

btn3 = types.InlineKeyboardButton("🔂 Bir martalik", callback_data="only_one")

back = types.InlineKeyboardButton("🔙Ortga", callback_data="back")

keyboard_l.add(btn1)

keyboard_l.add(btn2)

keyboard_l.add(btn3)

keyboard_l.add(back)

msg = bot.send_message(chat_id, "🎯 Xabarnoma turini tanlang",

reply_markup=keyboard_l)

bot.delete_message(message.chat.id,message.message_id)

#26.05.2020

elif m_text[2] == "." and m_text[5] == "." and int(m_text[0]) <= 3 and int(m_text[1]) <= 9 and not (int(m_text[0]) == 3 and int(m_text[1]) >= 1) and int(m_text[3]) <= 1 and int(m_text[4]) <= 9 and not (int(m_text[3]) == 1 and int(m_text[4]) >= 2) and int(m_text[6:10]) >= 2020:

if strptime(m_text, '%d.%m.%Y') > sana or m_text == today_date:

print(str(strptime(m_text, '%d.%m.%Y')))

session = Session()

session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).update(

{Rejim.day: m_text}, synchronize_session=False)

session.commit()

session.close()

keyboard_l = types.InlineKeyboardMarkup()

btn1 = types.InlineKeyboardButton("✅ Ha, vaqtni belgilash", callback_data="yes_time")

btn2 = types.InlineKeyboardButton("🙅‍♂️ Yo\'q, qayta tanlash", callback_data="only_one")

keyboard_l.add(btn1)

keyboard_l.add(btn2)

bot.send_message(chat_id, "📌 Xabarnomani


Download 86,78 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8   9   10




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish