2017-07-19 02:56:28 +03:00
|
|
|
import asyncio
|
|
|
|
|
import logging
|
|
|
|
|
|
2018-07-14 16:28:20 +03:00
|
|
|
from aiogram import Bot, types, Dispatcher, executor
|
2017-07-19 02:56:28 +03:00
|
|
|
|
|
|
|
|
API_TOKEN = 'BOT TOKEN HERE'
|
|
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
|
|
2019-07-15 14:00:38 +07:00
|
|
|
bot = Bot(token=API_TOKEN)
|
2017-07-19 02:56:28 +03:00
|
|
|
dp = Dispatcher(bot)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@dp.inline_handler()
|
|
|
|
|
async def inline_echo(inline_query: types.InlineQuery):
|
2017-11-28 17:23:35 +02:00
|
|
|
input_content = types.InputTextMessageContent(inline_query.query or 'echo')
|
2017-11-19 01:05:50 +02:00
|
|
|
item = types.InlineQueryResultArticle(id='1', title='echo',
|
2017-11-28 17:23:35 +02:00
|
|
|
input_message_content=input_content)
|
2017-07-19 02:56:28 +03:00
|
|
|
await bot.answer_inline_query(inline_query.id, results=[item], cache_time=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-07-15 14:00:38 +07:00
|
|
|
executor.start_polling(dp, skip_updates=True)
|