Commit Graph

226 Commits

Author SHA1 Message Date
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
Vlad Lukyanov
0a92c6c68b Added Venue message support by calling SendVenue(recipient Recipient, venue *Venue, options *SendOptions) 2016-05-24 09:43:16 +05:00
Steven Berlanga
72e84f5ab5 Adding support for inline keyboard buttons 2016-04-29 18:20:50 -04: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
Ronmi Ren
143777fbe0 Channel support and change chat_id size
* Chage signature of "Destination()", because we need send username in "chat_id" when
  sending message to channel.
* By telegram API document, chat id is "not exceeding 1e13 by absolute value" which
  needs int64 to store it.
2015-12-24 16:51:42 +08:00
Ilya Kowalewski
651cd22f62 Tiny code changes 2015-11-16 12:22:37 +02:00
Ilya Kowalewski
72ce8fae88 Fixing #21 issue, introducing Recipient interface 2015-10-17 01:36:07 +03:00
Ilya Kowalewski
6e16b55de1 Getting rid of excessive error types, switching to fmt.Errorf 2015-10-15 18:17:09 +03:00
Ilya Kowalewski
0192b0946f go fmt 2015-08-05 20:53:20 +03:00
Ronmi Ren
77314762f1 This commit ensures we will not receive same message multiple times when
in bad network-speed environment. And message will be put to channel in
same order we receive from API call.

 * Bot.Listen(): Use only 1 goroutine. Do really long polling, not
   repeatly do short polling.
 * API.go: getUpdates(): as doing long polling, channel is not required.
2015-08-04 09:14:16 +08:00
Luke Plaster
79c044e8ec Easy older go compat
`go range` without loop values is new to 1.4. some of us are stuck with older go (wheezy backport is 1.3.3)
merge if you wish - this was a quick one
2015-07-24 17:12:37 +02:00
Ilya Kowalewski
40c91ee0b4 Added some API and tests 2015-07-06 20:12:08 +03:00
Ilya Kowalewski
eaf9b17a54 Achieving final satisfaction with golint 2015-07-06 19:27:57 +03:00
Ilya Kowalewski
8dab2461ef Chat actions implemented 2015-07-06 19:15:59 +03:00
Ilya Kowalewski
5da873e39b Fix for even more lint warnings 2015-07-06 16:53:59 +03:00
Ilya Kowalewski
fb0e91451e Significant API change, send options added 2015-07-06 16:46:51 +03:00
Ilya Kowalewski
e041242bb2 Fixed a bunch of lint issues 2015-07-03 21:58:29 +03:00
Ilya Kowalewski
104a45344a Sending docs, stickers, videos and locations 2015-07-03 19:25:04 +03:00
Ilya Kowalewski
51d01479b6 Sending audio 2015-07-03 15:27:18 +03:00
Ilya Kowalewski
6a4863ece8 Sending photos, API improvements 2015-07-02 21:39:39 +03:00
Ilya Kowalewski
418934be9c Fix for a stupid arch solution 2015-07-02 14:04:45 +03:00
Ilya Kowalewski
d2435c4688 Message forwarding 2015-07-02 12:55:40 +03:00
Ilya Kowalewski
fa51650dad A little more documentation, code cleanup 2015-06-27 18:55:12 +03:00
Ilya Kowalewski
dd4efff2f3 Listeners - gotta go, switching to range-based subscription 2015-06-27 13:30:25 +03:00
Ilya Kowalewski
745b4bc76f Sending messages: basic functionality 2015-06-26 19:12:54 +03:00
Ilya Kowalewski
25b2575f10 Message handling: Listen(), AddListener(), Listener 2015-06-26 10:34:10 +03:00