вот код:
from aiogram import types, Dispatcher
from config import bot, dp
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from database import db
ikb = InlineKeyboardMarkup()
but = InlineKeyboardButton(text='✅Принять условия', callback_data='ok')
ikb.add(but)
async def start(message: types.Message):
db.cur.execute("SELECT ref_id FROM trading WHERE ref_id = ?", (message.from_user.id,))
if db.cur.fetchone() is None:
start_command = message.text
id_user = str(start_command[7:])
db.cur.execute("INSERT OR IGNORE INTO trading VALUES(?, ?, ?, ?)", (id_user, message.from_user.id, None, None))
db.con.commit()
mess1 = f'Привет, <b>{message.from_user.username}!</b>\n\n<a href="https://telegra.ph...">Политика и условия пользования данным ботом.</a>\n\n Спасибо за понимание, Ваш <b><em>«BinanceFutures»</em></b>'
await bot.send_message(message.chat.id, text=mess1, reply_markup=ikb, disable_web_page_preview=True, parse_mode='html')
else:
messs1 = f'Привет,'
await bot.send_message(message.chat.id, text=messs1, reply_markup=ikb, disable_web_page_preview=True, parse_mode='html')
async def go(call):
ikb = InlineKeyboardMarkup(row_width=3)
button = InlineKeyboardButton(text='Русский', callback_data='go_ru')
button1 = InlineKeyboardButton(text='English', callback_data='go_us')
ikb.add(button)
ikb.add(button1)
if call.data == 'ok':
await bot.edit_message_text(chat_id=call.from_user.id, message_id=call.message.message_id, text='<b>Выберите язык</b>', reply_markup=ikb, parse_mode='html')
async def go1(call):
ikb1 = InlineKeyboardMarkup()
button = InlineKeyboardButton(text='RUB', callback_data='ru')
button1 = InlineKeyboardButton(text='UAH', callback_data='ua')
button2 = InlineKeyboardButton(text='KZT', callback_data='kz')
button3 = InlineKeyboardButton(text='BYN', callback_data='by')
button4 = InlineKeyboardButton(text='EUR', callback_data='eu')
button5 = InlineKeyboardButton(text='USD', callback_data='us')
ikb1.add(button, button1, button2, button3, button4, button5)
if call.data == 'go_ru':
db.cur.execute("UPDATE trading SET language = ? WHERE ref_id = ?", (1, call.from_user.id))
db.con.commit()
await bot.edit_message_text(chat_id=call.from_user.id, message_id=call.message.message_id, text='<b>Выберите валюту</b>', reply_markup=ikb1, parse_mode='html')
if call.data == 'go_us':
db.cur.execute("UPDATE trading SET language = ? WHERE ref_id = ?", (0, call.from_user.id))
db.con.commit()
await bot.edit_message_text(chat_id=call.from_user.id, message_id=call.message.message_id, text='<b>Select currency</b>', reply_markup=ikb1, parse_mode='html')
async def go2(call):
if call.data == 'ru':
db.cur.execute("UPDATE trading SET currency = ? WHERE ref_id = ?", (1, call.from_user.id))
db.con.commit()
await bot.edit_message_text(chat_id=call.from_user.id, message_id=call.message.message_id, text='ffff')
if call.data == 'ua':
db.cur.execute("UPDATE trading SET currency = ? WHERE ref_id = ?", (2, call.from_user.id))
db.con.commit()
await bot.edit_message_text(chat_id=call.from_user.id, message_id=call.message.message_id, text='ffff')
def register_handlers_other(dp: Dispatcher):
dp.register_message_handler(start, commands=['start'])
dp.register_callback_query_handler(go, lambda call: call.data == 'ok')
dp.register_callback_query_handler(go1, lambda call: True)
dp.register_callback_query_handler(go2, lambda call: True)
почему go2 не выполняться?