message.content
@bot.event
async def on_message(message):
if "привет" in str(message.content).lower():
await message.channel.send("Привет, друг")
.lover()
и все будет работать хорошо.lover()
@bot.event
async def on_message(message):
if "привет" in str(message.content):
await message.channel.send("Привет, друг")
@dp.message_handler(text=['Магазин'])
async def shop(message: types.Message):
await message.answer("Выберите подраздел: ", reply_markup=inline_kb_full2)
@dp.callback_query_handler(lambda c: c.data == 'A')
async def process_callback_button1(callback_query: types.CallbackQuery):
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user.id, 'Нажата первая кнопка!', reply_markup=inline_kb_full3)
@dp.callback_query_handler(lambda c: c.data == 'A')
async def process_callback_button1(callback_query: types.CallbackQuery):
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user.id, 'Нажата первая кнопка!', reply_markup=inline_kb_full3)
from aiogram import Bot, Dispatcher, executor, types
from config import TOKEN
bot = Bot(TOKEN)
dp = Dispatcher(bot)
@dp.message_handler()
async def tex(message: types.Message):
await bot.send_message(message.chat.id, message.text)
with open('tee.txt', 'a+') as file_tee:
file_tee.write(f'{message.from_user.first_name} - {message.text}\n')
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
with open('tee.txt', 'a+') as file_tee:
file_tee.write(f'{message.from_user.first_name} - {message.text}\n')