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



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

27.09.2020",

parse_mode='html',reply_markup=markup)

bot.answer_callback_query(call.id, "Endi xabarnomani jo\'natish sanasini yuboring")

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

bot.register_next_step_handler(msg, data_sana_step)

elif call.data == "one_back":

markup = types.ReplyKeyboardMarkup(resize_keyboard=True)

markup.row('📣 Yangi xabarnomani qo\'shish')

markup.row('🔕 O\'rnatilgan xabarnomani o\'chirish')

bot.answer_callback_query(call.id, "Ortga")

bot.send_message(chat_id, "Men Grootman 🌱",

reply_markup=markup, parse_mode="html")

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

elif call.data == "back":

bot.answer_callback_query(call.id, "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(call.from_user.id, "🎯 Xabarnoma turini tanlang",

reply_markup=keyboard_l)

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

elif call.data in weekdays:

if call.data == "Monday":

bot.answer_callback_query(call.id, "Dushanba kuni belgilandi")

if call.data == "Tuesday":

bot.answer_callback_query(call.id, "Seshanba kuni belgilandi")

if call.data == "Wednesday":

bot.answer_callback_query(call.id, "Chorshanba kuni belgilandi")

if call.data == "Thursday":

bot.answer_callback_query(call.id, "Payshanba kuni belgilandi")

if call.data == "Friday":

bot.answer_callback_query(call.id, "Juma kuni belgilandi")

if call.data == "Saturday":

bot.answer_callback_query(call.id, "Shanba kuni belgilandi")

if call.data == "Sunday":

bot.answer_callback_query(call.id, "Yakshanba kuni belgilandi")

try:

session = Session()



days = session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).order_by(Rejim.id.desc()).first()

new_day = days.day

if new_day is None:

up_id = session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).order_by(Rejim.id.desc()).first().id

session.query(Rejim).filter(Rejim.id == up_id).update({Rejim.day: call.data}, synchronize_session=False)

else:


new_day = new_day + ' ' + call.data

up_id = session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).order_by(Rejim.id.desc()).first().id

session.query(Rejim).filter(Rejim.id == up_id).update({Rejim.day: new_day}, synchronize_session=False)

session.commit()

session.close()

except Exception as e:

bot.send_message(config.admin_id, e)

elif call.data == "next":

session = Session()

days = session.query(Rejim).filter(Rejim.user_id == chat_id).filter(Rejim.finish == 0).order_by(Rejim.id.desc()).first()

day = days.day

need_day = day.split()

kunlar=""

for i in need_day:

if i == "Monday":

kunlar = kunlar+"Dushanba "

if i == "Tuesday":

kunlar = kunlar+"Seshanba "

if i == "Wednesday":

kunlar = kunlar+"Chorshanba "

if i == "Thursday":

kunlar = kunlar+"Payshanba "

if i == "Friday":

kunlar = kunlar+"Juma "

if i == "Saturday":

kunlar = kunlar+"Shanba "

if i == "Sunday":

kunlar = kunlar+"Yakshanba "

else:

kunlar = kunlar+""



keyboard_l = types.InlineKeyboardMarkup()

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

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

keyboard_l.add(btn1)

keyboard_l.add(btn2)

bot.send_message(chat_id, "


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