Commit Graph

155 Commits

Author SHA1 Message Date
Ian Byrd
2f62e39c40
Sending photos by URL. 2017-11-18 20:33:20 +02:00
Ian Byrd
7316e92265
Viva la File, my boys, viva la File! 2017-11-18 20:16:16 +02:00
Ian Byrd
b6938a118c
Telebot now compiles! :-) 2017-11-18 16:44:57 +02:00
Ian Byrd
dbc2cd7f6d
Massive refactoring and file structure changes.
- Callback structs has been moved to callbacks.go
- User / Chat and its methods -> chat.go
- Concept of Editable and Message Signature introduced
- No more types.go, it's been refactored into media.go + friends
2017-11-18 15:06:20 +02:00
Ian Byrd
264d5cd726
Removed omitempty from struct that never gets marshalled. 2017-11-18 12:31:13 +02:00
Ian Byrd
a8671a839d
More refactoring, API rethinking. 2017-11-18 12:19:58 +02:00
Ian Byrd
3cf300d59d
Documentation for latest changes. 2017-11-17 16:29:44 +02:00
Ian Byrd
9e92b919f8
Refining ReplyMarkup API. 2017-11-17 15:55:18 +02:00
Ian Byrd
d4f3a16377
KeyboardButton, InlineButton are now distinct types. 2017-11-17 15:37:16 +02:00
Ian Byrd
e1f4f1b228
Thumbnail -> Photo, new types supported: Voice, VideoNote. 2017-11-17 15:10:18 +02:00
Ian Byrd
6eec63ddbb
Delete() has been added. 2017-11-17 09:22:16 +02:00
Ian Byrd
c1fcf065ae
Adjusted README.md for the changes 2017-11-17 08:41:48 +02:00
Ian Byrd
476a198f9e
Adjusting telebot_test.go for new changes 2017-11-17 08:32:51 +02:00
Ian Byrd
4b10ca4b49
Typos in T.Send() 2017-11-17 08:28:41 +02:00
Ian Byrd
ef59af6db7
Introducing Sendable interface (see #93.)
This commit refactors lots of duplicated code from bot.go, so
instead of having N redundant SendX methods, now it's the
responsibility of all Sendable objects to implement Send(..)
instead. Impl in types_send.go, 150 LOC only!
2017-11-17 08:20:36 +02:00
Ian Byrd
127bf18d79
Optimizes SendOptions / ReplyMarkup. 2017-11-17 04:51:03 +02:00
Ian Byrd
9bb53f41f1 Various minor breaking changes to structs involving Message / User. 2017-08-25 16:27:59 +03:00
Ian Byrd
d8b3194888 Message: optionals are now stored by-pointer, saving 67.4% of mem.
This is a breaking change! Reducing memory usage from 1544 bytes
down to 504 bytes on 64-bit system. Considering Message is the
most used Telebot type, it's a pretty big deal.

Also, now we finally can test optional fields against nil!
2017-08-25 16:27:58 +03:00
Ian Byrd
4857ac8b9d
Whoops, fixing the merged code according to new API. 2017-08-19 19:19:57 +03:00
Ian Byrd
8128e90034
Merging #79 into 'v2'.
This commit breaks telebot API by introducing message edits and
changing return values for existing Send* methods.
2017-08-19 19:10:02 +03:00
Ian Byrd
2d298dfca8 Simple pluggable serve-and-handle API 2017-08-19 19:02:14 +03:00
Ian Byrd
f7a78ef0fc
Message should be passed by-value. 2017-08-19 18:58:10 +03:00
Ian Byrd
7acb52c3cf
Handlers will be executed in separate goroutines. 2017-08-19 15:25:35 +03:00
Ian Byrd
ad382bdb6b
Context.Msg -> Context.Message (for consistency). 2017-08-17 19:34:38 +03:00
Ian Byrd
b718278f36
Fixing excessive panicing. 2017-08-17 19:18:36 +03:00
Ian Byrd
b19ffa1b45
Experimental handlers API added. 2017-08-15 18:00:22 +03:00
Ian Byrd
a1a2c92dad
This commit refactors error handling throughout the library.
Bot.Errors channel has been introduced. It can be used to
debug Telebot. It also fixes sendFile() which used to upload
with its own custom http.Client instead of http.DefaultClient.
2017-08-15 16:44:01 +03:00
Ian Byrd
95901bcfc3
Minor time conversion change within private API. 2017-08-15 15:09:04 +03:00
Ian Byrd
a6b93fe7e9 Revert "Prevent the build from failing no more."
This reverts commit 3533141572.
2017-08-11 05:30:17 +03:00
Ian Byrd
14151d8a26 Revert "Bots now support custom HTTP clients (*http.Client)."
This reverts commit c8e1ac037f.
2017-08-11 05:29:55 +03:00
Ian Byrd
3533141572
Prevent the build from failing no more. 2017-08-03 02:44:51 +03:00
Ian Byrd
c8e1ac037f
Bots now support custom HTTP clients (*http.Client). 2017-08-03 02:14:18 +03:00
Ian Byrd
e6a8b961e7 Merge pull request #84 from irgendwr/patch-1
Adding support for forwarded messages from channels.
2017-08-03 01:38:31 +03:00
Ian Byrd
e5d60e6913
Replace IQR*.MarshalJSON with InlineQueryResultBase
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).
2017-08-03 01:30:37 +03:00
Vlad Lukyanov
d2067e919f changed InlineKeyboardMarkup to SendOptions where it needed 2017-05-10 12:08:11 +05:00
irgendwer / Jonas
12099b9b19 support for forwarded messages from channels
This would fix the problem that forwarded messages from channels don't get detected as forwarded and allows you to get the chat id of the channel the message was originally posted to.
2017-02-25 02:29:09 +01:00
Vlad Lukyanov
15a4d8f413 Add meaasge edit feature
This commit may break some bots because changes in return of SendMessage
and SendPhoto functions
2017-01-12 05:48:11 +05:00
Vlad Lukyanov
ae8106fc82 Merge pull request #1 from tucnak/master
Merge with upstream
2016-11-28 17:27:48 +05:00
Ian Byrd
196512b59e
Keeping PR up-to-date with recent master changes. 2016-11-10 22:15:13 +02:00
Ian Byrd
7c002850b1
Typo infereIQR -> inferIQR. 2016-11-10 22:10:37 +02:00
Ian Byrd
6360f1f7d9
Refactoring, poor BC, closes #44 and probably resolves #41.
- EntityType and ChatType enums introduced.
- Documentation fixes, struct refactoring.
- Poor BC, poor BC...
2016-11-10 22:04:50 +02:00
Ian Byrd
d8b2ca1983
Fixes lots of complete bollocks that got into the codebase.
- Malformed JSON field tags, OMG fixed
- Making linters happy
- Foursquare_id -> FoursquareID, fuck BC
2016-11-10 21:34:02 +02:00
Ian Byrd
276daa0732
README.md bikeshedding. 2016-11-10 21:32:23 +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
fedfe0d5f9 Switching to int64 update queries, resolves #16 hopefully. 2016-11-10 01:34:57 +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
Ian Byrd
3a6f49efc1
Audio gets extended with optional fields, closes #11. 2016-11-10 00:05:01 +02:00
Ian Byrd
a669eb6140 Merge pull request #72 from ahmdrz/master
URL in CallbackResponse Type added
2016-11-09 23:28:42 +02:00
Ahmadreza Zibaei
050aa8e2cc Merge branch 'master' into master 2016-11-09 11:34:51 +03:30