def phone_number(message): phone_number = message.contact.phone_number #mysql_db = MySQL() db = SQLight() print(phone_number) #exists = mysql_db.select_users(phone_number) # Uncomment if needed exists = True if (exists): if not db.check_user_exists(phone_number): db.register_user(message.from_user.id, phone_number, exists) ia_zhok = telebot.types.InlineKeyboardMarkup() row_1 = [ telebot.types.InlineKeyboardButton("Салам бар", callback_data="salaБар") ] row_2 = [ telebot.types.InlineKeyboardButton("Қабілетімді анықтағым келеді", callback_data="salaЖоқ") ] # ozgertu bot ia_zhok.row(*row_1) ia_zhok.row(*row_2) bot.send_message( message.from_user.id, "<a href='https://www.youtube.com/watch?v=OWJlNyZx08E'>Сала таңдауға жалпы шолу</a>", parse_mode="HTML", reply_markup=ia_zhok) return bot.send_message(message.from_user.id, "<b>Кешіріңіз, сіз біздің базада тіркелмегенсіз.</b>", parse_mode="HTML") return
def kadam_5_pikir(message): if check_message(message.text, message): kadam_5_pikir = message.text #5 Қадам пікір print(message.text) db = SQLight() db.update_kadam_5(123, kadam_5_pikir) bot.send_message( message.from_user.id, "<a href='https://www.youtube.com/watch?v=D8wW7ycIHBE'>Қорытынды</a>", parse_mode="HTML", reply_markup=zhukteu_batyrma()) dbworker.set_state(message.chat.id, config.States.korytyndy.value)
def kadam_3_pikir(call): bot.answer_callback_query(call.id, text="Күте тұрыңыз...") kadam_3_pikir = call.data #3 Қадам пікір Onim,Satu adam db = SQLight() db.update_kadam_3(123, kadam_3_pikir) bot.send_message( call.from_user.id, "<a href='https://www.youtube.com/watch?v=CBpjXXj9an4'>4 Қадам</a>", parse_mode="HTML") bot.send_message(call.from_user.id, "<b>Келесі қадамға өту үшін, пікір қалдырыңыз</b>" + u"\U0001F447", parse_mode="HTML") #, reply_markup=ia_menu()) dbworker.set_state(call.from_user.id, config.States.kadam_4_pikir.value)
def syltaular(message): if check_message(message.text, message): print(message.text) syltaular = message.text #Сылтаулар db = SQLight() db.update_syltau(123, syltaular) bot.send_message( message.from_user.id, "<a href='https://www.youtube.com/watch?v=CTeRikeIcsQ'>1 Қадам</a>", parse_mode="HTML") bot.send_message(message.from_user.id, "<b>Төменге нәтижесін жазыңыз</b>" + u"\U0001F447", parse_mode="HTML") #, reply_markup=ia_menu()) dbworker.set_state(message.chat.id, config.States.kadam_1_pikir.value)
def kadam_4_pikir(message): if check_message(message.text, message): kadam_4_pikir = message.text #4 Қадам пікір print(message.text) db = SQLight() db.update_kadam_4(123, kadam_4_pikir) bot.send_message( message.from_user.id, "<a href='https://www.youtube.com/watch?v=xIDxWY_7nfc'>5 Қадам</a>", parse_mode="HTML") bot.send_message(message.from_user.id, "<b>Келесі қадамға өту үшін, пікір қалдырыңыз</b>" + u"\U0001F447", parse_mode="HTML") #, reply_markup=ia_menu()) dbworker.set_state(message.chat.id, config.States.kadam_5_pikir.value)
def Ia_Jok(call): zhauap = call.data[4:] db = SQLight() reply_markup = telebot.types.ReplyKeyboardRemove() if zhauap == 'Бар': db.update_sala(123, zhauap) bot.answer_callback_query(call.id, text="Күте тұрыңыз...") bot.send_message( call.from_user.id, "<a href='https://www.youtube.com/watch?v=lJ-7CODAQqc'>Саласы бар</a>", parse_mode="HTML", reply_markup=zhukteu_batyrma()) return bot.answer_callback_query(call.id, text="Күте тұрыңыз...") db.update_sala(123, zhauap) markup = telebot.types.InlineKeyboardMarkup() row_1 = [ telebot.types.InlineKeyboardButton(text="Саламды анықтағым келеді", callback_data='#') ] markup.row(*row_1) bot.send_message( call.from_user.id, "<a href='https://www.youtube.com/watch?v=uWRvrdOyBXA'>Салам бар, бірақ өзім білмеймін</a>", parse_mode="HTML", reply_markup=markup) dbworker.set_state(call.from_user.id, config.States.kirispe_pikir.value)
def kadam_1_pikir(message): if check_message(message.text, message): print(message.text) kadam_1_pikir = message.text #1 Қадам пікір db = SQLight() db.update_kadam_1(123, kadam_1_pikir) markup = telebot.types.InlineKeyboardMarkup() row_1 = [ telebot.types.InlineKeyboardButton(text="Видеоларды жүктеу", callback_data='zhukteuVideo') ] row_2 = [ telebot.types.InlineKeyboardButton(text="Келесі қадамға өту", callback_data='kadam_3') ] markup.row(*row_1) markup.row(*row_2) bot.send_message( message.from_user.id, "<a href='https://www.youtube.com/watch?v=FX3Txp-j6V8'>2 Қадам</a>", parse_mode="HTML", reply_markup=markup)
def text_message(message): if message.text == 'excel': db = SQLight() db.get_excel(message.from_user.id) return