Commit Graph

13 Commits

Author SHA1 Message Date
Ian Byrd
bda24d8650 Possibly breaking some builds, but inline message IDs won't work
otherwise.
2017-12-27 00:39:15 +02:00
Ian Byrd
77d1ba9eb1 Inline mode fix. 2017-11-29 22:31:07 +02:00
Ian Byrd
5ba925eaba
Completing inline API, closing #104. 2017-11-26 10:17:52 +02:00
Ian Byrd
612ab345bd Improved inline API. TODO proper result types. 2017-11-24 16:11:07 +02:00
Ian Byrd
0f1d521167
Cleanup, documentation, bikeshedding. 2017-11-19 17:21:25 +02:00
Ian Byrd
7c002850b1
Typo infereIQR -> inferIQR. 2016-11-10 22:10:37 +02:00
Ian Byrd
acbbb524dc
Documentation for newly introduced methods. 2016-11-10 20:05:52 +02:00
Ian Byrd
a6c1dce4e0
Replace IQR*.MarshalJSON with InlineQueryResultBase, fixes #75.
This commit gets rid of multiple redundant copies of MarhsalJSON()
method present for all existing IQR. It does so by introducing a
new struct called InlineQueryResultBase, which takes care of new
Type (for JSON) and existing duplicated ID field.

InlineQueryResults is a new helper wrapper for []IQR slices. It
implements MarshalJSON, which makes sure IQR.ID and IQR.Type are
set properly (by computing a hash and infering IQR type).
2016-11-10 19:52:45 +02:00
Ian Byrd
e0d2195801
Partial refactoring of internals.
- GetChat and LeaveChat handle error descriptions
- Documentation fix for Result type
- Wrapping structs for IQRs go inside marshal funcs.
2016-11-10 01:28:00 +02:00
Nick Groenen
46992b037b Improve support for inline queries
These changes make it possible to set custom options when responding to
inline queries, as described on
https://core.telegram.org/bots/api#answerinlinequery.

It also includes all the (non-cached) inline result types as described
at https://core.telegram.org/bots/api#inlinequeryresult.

Some remarks:
* The internals of sendCommand have changed. It now expects a
  JSON-serializable object. Instead of doing GET requests with
  URL-encoded query parameters it now POSTS JSON directly.
* Because of the above, sendFile() has changed as well. It now expects a
* `map[string]string` which it will internally convert to URL encoded
  form values.
* Respond has been deprecated in favor of the new AnswerInlineQuery
  function. It is only kept for backward compatibility.
* A dependency on https://github.com/mitchellh/hashstructure has been
  introduced in order to generate automatic IDs for inline results.
2016-06-26 16:33:16 +02:00
Ian Byrd
12182e36dc
Minor documentation fixes, resolves #49 2016-06-26 10:15:11 +03:00
Ian Byrd
ce6937b17c
i'm dumb... 2016-01-22 15:03:58 +02:00
Ian Byrd
061a651188
This commit adds an inline mode implementation and resolves #28.
Only article results supported so far.
2016-01-22 13:38:45 +02:00