@dp.message_handler(commands=['search'])
async def search(message):
connect = sqlite3.connect('users.db')
cursor = connect.cursor()
def search_db():
cursor.execute("SELECT * FROM users")
all_results = cursor.fetchall()
connect.commit()
await bot.send_message(message.chat.id, all_results)
@dp.message_handler(content_types=['text'])
async def text(message):
await bot.send_message(message.chat.id, message.text)
connect = sqlite3.connect(message.text + '.db')
cursor = connect.cursor()
connect.commit()