Всем привет кто знает как можно передать функцию agree в main.py вот код
#callback_queries.py
from aiogram import types
async def agree(callback_query: types.CallbackQuery, bot):
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user.id, "Спасибо за обращение!")
# main.py
from aiogram import Bot, Dispatcher, executor
from message_handlers import start
from config import TOKEN
from callback_queries import agree
bot = Bot(TOKEN)
dp = Dispatcher(bot)
dp.register_message_handler(lambda msg: start(msg, bot), commands=['start'])
dp.register_callback_query_handler(
lambda agre: start(agre ,bot=bot),
lambda c: c.data == 'agree'
)
if __name__ == '__main__':
executor.start_polling(dp)
#inlineuttons.py
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
agreemend = InlineKeyboardMarkup().add(InlineKeyboardButton('✅ Yes I agree', callback_data='agree'))