justdmitry / NetTelegramBotApi

C# client library for building Telegram bot
MIT License
74 stars 28 forks source link

AnswerInlineQuery in NetTelegramBotApi #58

Closed rasools13 closed 3 years ago

rasools13 commented 7 years ago

I use NetTelegramBotApi to creat my bot, but I cann't find AnswerInlineQuery method to handle inlineQuery?

justdmitry commented 7 years ago

Inline mode is not complete - you may create required classes yourself using one of existing as a sample.

rasools13 commented 7 years ago

hi again @justdmitry
I created all necessary classes for AnswerInlineQuery (see the attachment files) and everything looks good, but I encounter "Invalid Inline_Query_Id" error when using that.

InlineQueryResult inline_result = new InlineQueryResult();
InputTextMessageContent txtmesg = new InputTextMessageContent();
txtmesg.MessageText = "this is inline nessage content";
inline_result.InputMessageContent = txtmesg;
inline_result.Title = "inline title";

await bot.MakeRequestAsync(new AnswerInlineQuery(UpD.InlineQuery.Id, inline_result));

Requests.zip

justdmitry commented 7 years ago

It's hard to say where the problem is looking into archive. I see "strange" property names, possibly conflicting with JSON serializer settings... Can you make a PR or commit changes to branch in your fork?