@bot.inline_handler(lambda query: query.query == 'text')
def query_text(inline_query):
try:
r = types.InlineQueryResultArticle('1', 'text', types.InputTextMessageContent('2'))
bot.answer_inline_query(inline_query.id, [r])
except Exception as e:
print(e)