import asyncio
from aiogram import types
from aiogram import Bot, Dispatcher, F
from aiogram.types import Message
from aiogram.filters import Command
from aiogram.filters.callback_data import CallbackData, CallbackQuery
from aiogram.types import (
ReplyKeyboardMarkup,
KeyboardButton,
InlineKeyboardMarkup,
InlineKeyboardButton,
KeyboardButtonPollType
)
import keyboard
links_kb = InlineKeyboardMarkup(
inline_keyboard=[
[
InlineKeyboardButton(text="Предложить сделку", callback_data="hh"),
InlineKeyboardButton(text="Отзывы", url='
tg://resolve?domain=tisamitemki')
]
]
)
bot = Bot(token="TOKEN", parse_mode='HTML')
dp = Dispatcher()
@dp.message(Command('start'))
async def start(message: Message):
await message.answer(f'Hello,
{message.from_user.first_name}')
await message.answer(text = 'lalal', reply_markup=keyboard.main_kb)
@dp.message(F.text == '@NazarRol')
async def jjj(message: Message):
await message.answer(text='profile', reply_markup=keyboard.links_kb)
@dp.callback_query(lambda query: query.data == 'hh')
async def handle_callback_query(query: types.CallbackQuery):
await query.answer("Привіт!")
@dp.message()
async def echo(message: Message):
msg = message.text.lower()
if msg == "найти user":
await message.answer("Введите никнейм в формате @username")
async def main():
await bot.delete_webhook(drop_pending_updates=True)
await dp.start_polling(bot)
asyncio.run(main())
вот код
from aiogram.types import (
ReplyKeyboardMarkup,
KeyboardButton,
InlineKeyboardMarkup,
InlineKeyboardButton,
KeyboardButtonPollType
)
from aiogram.filters.callback_data import CallbackData, CallbackQuery
main_kb = ReplyKeyboardMarkup(
keyboard=[
[
KeyboardButton(text="Найти user"),
KeyboardButton(text=" Мой профиль")
],
[
KeyboardButton(text="Отзывы"),
KeyboardButton(text=" Помощь")
]
],
resize_keyboard=True, #маленькі кнопки
)
links_kb = InlineKeyboardMarkup(
inline_keyboard=[
[
InlineKeyboardButton(text="Предложить сделку", callback_data="sdelka"),
InlineKeyboardButton(text="Отзывы", url='
tg://resolve?domain=tisamitemki')
]
]
)
вторая часть