Ну ошибку и код стоит привести...
import sqlite3 as lite
import sys
import telebot
from telebot import types
bot = telebot.TeleBot('')
@bot.message_handler(commands = ['start'])
def start(message):
markup = types.ReplyKeyboardMarkup(resize_keyboard= True, row_width = 2)
btn1 = types.KeyboardButton('Ташкент')
btn2 = types.KeyboardButton('Фергана')
btn3 = types.KeyboardButton('Наманган')
btn4 = types.KeyboardButton('Андижан')
btn5 = types.KeyboardButton('Кашкадарья')
btn6 = types.KeyboardButton('Сурхандарья')
btn7 = types.KeyboardButton('Навои')
btn8 = types.KeyboardButton('Самарканд')
btn9 = types.KeyboardButton('Сырдарья')
btn10 = types.KeyboardButton('Бухара')
btn11 = types.KeyboardButton('Жиззах')
btn12 = types.KeyboardButton('Хорезм')
markup.add(btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn10, btn11, btn12)
send_mess = f"<b>Привет {message.from_user.first_name}!</b>\n"
bot.send_message(message.chat.id, send_mess, parse_mode='html',reply_markup = markup)
@bot.message_handler(content_types = ['text'])
def getLoc(message):
final_message = ""
location = message.text.strip().lower()
con = lite.connect('baza.db')
with con:
cur = con.cursor()
cur.execute('SELECT * FROM `data_ru` WHERE `region` = location ORDER BY `name` LIMIT 30')
rows = cur.fetchall()
for row in rows:
final_message = row
bot.send_message(message.chat.id, final_message, parse_mode='html',reply_markup = markup)
bot.polling(none_stop=True)