Commit graph

630 commits

Author SHA1 Message Date
Temirkhan Myrzamadi
9e4f9e8392
Update src/types/message.rs
Co-Authored-By: Waffle Lapkin <waffle.lapkin@gmail.com>
2019-12-12 00:22:33 +06:00
Temirkhan Myrzamadi
082a916e40 Remove unnecessary 'Optional' in docs 2019-12-12 00:18:05 +06:00
Temirkhan Myrzamadi
32e970148e Use the nice crate:🅰️🅱️:c syntax in docs 2019-12-12 00:07:50 +06:00
Temirkhan Myrzamadi
fc4a1dff9e Fix the Clippy's warning 2019-12-11 22:27:42 +06:00
Temirkhan Myrzamadi
80fb280f2a Fix the docs of the API types 2019-12-11 22:19:48 +06:00
Waffle
7b3c51ff1b Rename the lib to "teloxide" 2019-12-07 22:30:15 +03:00
Waffle
a4309ef4d8 clippy 2019-12-07 19:42:36 +03:00
Waffle
852df2e90e remove feature(never_type) since it's stable since 1.41.0 (latest nightly) 2019-12-07 19:17:32 +03:00
Waffle Lapkin
81f8ef2575
Merge branch 'dev' into requests_rewrite 2019-12-07 18:53:34 +03:00
Waffle
bcb11ea9a9 fmt 2019-12-07 18:51:23 +03:00
Waffle
0a1bc8d538 Implement all (I Hope) telegram methods 2019-12-07 18:50:35 +03:00
Waffle
d91430e180 Add come derives to some types 2019-12-07 15:27:29 +03:00
Waffle
fa099b4ca8 Suppress clippy 2019-12-07 15:26:03 +03:00
Waffle
648ce5c00e clippy 2019-11-27 18:47:06 +03:00
Waffle
4ae4539631 fmt 2019-11-27 18:13:20 +03:00
Waffle
7fea75f2d7 fix build on the latest nightly 2019-11-27 18:12:32 +03:00
Waffle
a9c97c5074 remove old Request trait 2019-11-27 17:19:57 +03:00
Waffle
9b8d9eba9b fmt + doc fixes 2019-11-27 17:07:13 +03:00
Waffle
ef15a4167f Fix warnings: unused imports + forgotten pub on GetMe::new 2019-11-27 16:16:44 +03:00
Waffle
e673335e1f Fix todo: use get_updates in polling 2019-11-27 16:14:37 +03:00
Waffle
4f77f8f371 Reimplement GetFile request 2019-11-27 16:12:27 +03:00
Waffle
2009e78b5f Fix typo (seriosly? why haven't I built it before? no one knows) 2019-11-08 11:13:36 +03:00
Waffle
8056872c02 Remove "simple" request-related things 2019-11-08 01:52:04 +03:00
Waffle
a20b3f132a Derive default for GetMe 2019-11-07 19:04:57 +03:00
Waffle
49cc1451d4 Add Bot::execute_{dyn,json,multipart,simple} methods 2019-11-07 01:25:07 +03:00
Waffle
4177d20e54 Derive From for ChatId again 2019-11-07 01:24:13 +03:00
Waffle
08bf30296c Add InputFile::{file,url,file_id} constructors 2019-11-07 01:13:38 +03:00
Waffle
5f86362f17 Rename Method::METHOD => NAME, DynMethod::method => name 2019-11-06 23:49:56 +03:00
Waffle
c0953893b5 Add Bot::{get_updates, get_me, send_message, send_animation} 2019-11-05 19:45:56 +03:00
Waffle
fa220a6883 Add reference implementation of payloads 2019-11-05 19:32:22 +03:00
Waffle
7e821f2401 Small fixes in derived traits and docs of ChatId, ReplyMarkup and ReplyMarkup-related structs 2019-11-05 19:27:03 +03:00
Waffle
56a33df68c Serialize into FormValue by ref 2019-11-05 19:25:57 +03:00
Waffle
f3d554c9a5 Remove derive Serialize for InputFile 2019-11-05 19:01:03 +03:00
Waffle
93344c5d06 Derive Deserialize and Serialize on InputFile 2019-11-05 18:57:30 +03:00
Waffle
b13472cbcd Remove some commented things 2019-11-05 18:56:52 +03:00
Waffle
80ad646869 Move Output type and method fn from dynamic::Payload to new DynMethod trait 2019-11-05 18:55:13 +03:00
Waffle
521eef7550 Remove old requests 2019-11-05 17:10:41 +03:00
Waffle
be11633d6e Make dynamic::Request _really_ dynamic (ooops) 2019-11-05 00:51:15 +03:00
Waffle
e2922199d4 Add some docs 2019-11-05 00:47:31 +03:00
Waffle
86f9e9911c Add #[must_use] on requests 2019-11-05 00:34:48 +03:00
Waffle
0b750f2ac1 Add dynamic::{Kind, Payload, Request} (they are needed for storing _some_ request with concrete output) 2019-11-05 00:28:47 +03:00
Waffle
b788da0608 Move modules to files 2019-11-05 00:06:52 +03:00
Waffle
7868d9c832 Add simple::{Payload, Request} 2019-11-05 00:00:26 +03:00
Waffle
b02f10e73c Move Output type and METHOD const from Payloads to Method trait 2019-11-04 23:56:54 +03:00
Waffle
4c2e8029a9 Add multipart::{Payload, Request} 2019-11-04 23:54:19 +03:00
Waffle
602d07623b Add json::{Payload, Request} 2019-11-04 23:48:38 +03:00
Waffle
0a36537aa5 Comment all the deprecated stuff 2019-11-04 22:45:14 +03:00
Temirkhan Myrzamadi
478cde4c3f Oops 2019-11-04 01:03:56 +06:00
Temirkhan Myrzamadi
f8851eabff Rework HandlerAndFilter::new 2019-11-04 01:03:04 +06:00
Temirkhan Myrzamadi
60391de28a Add FilterAndHandler::new 2019-11-03 19:33:24 +06:00
Temirkhan Myrzamadi
89db95ef3f Simplify 'type Handlers = ...' (dispatchers/filter/mod.rs) 2019-11-03 19:16:38 +06:00
Temirkhan Myrzamadi
ce2e949cb1
Merge pull request #78 from telebofr/error_policy
Error policy
2019-11-02 14:33:07 +00:00
Waffle
5c73af4a6f Add Ignore and IgnoreSafe error policies. 2019-11-02 17:15:13 +03:00
Waffle
4423a992c0 Fix indent for where 2019-11-02 16:50:32 +03:00
Waffle
3f2d049c22 Fix ErrorPolicy by implementing trait on all Fn() -> Fut by-hands (and some related small fixes) 2019-11-02 15:55:54 +03:00
Waffle Lapkin
31c9a44276
Merge branch 'dev' into cows_for_form_builder 2019-11-02 02:12:34 +03:00
Waffle
5b0f8e8c0e little simplification/optimization (use Cow in FormBuilder
)
2019-11-02 02:10:39 +03:00
Temirkhan Myrzamadi
a537830472 An another try to implement ErrorPolicy for FnMut 2019-11-01 22:09:27 +06:00
Temirkhan Myrzamadi
1d9c42c309 Fix 2019-11-01 21:51:09 +06:00
Temirkhan Myrzamadi
65e003120d Add comments (error_policy.rs) 2019-10-31 15:50:36 +06:00
Temirkhan Myrzamadi
a2eda602c0 A erroneous implementation of trait ErrorPolicy 2019-10-31 15:42:18 +06:00
Temirkhan Myrzamadi
04dd861f51 Fmt 2019-10-29 01:28:38 +06:00
P0lunin
262031cd81 moved filters from ..\dispatching\dispatchers\filter\ to ..\dispatching\ 2019-10-25 18:16:10 +03:00
P0lunin
0add325e31 optimized tests 2019-10-25 18:09:56 +03:00
P0lunin
9feaf63362 added MessageTextCaptionFilter 2019-10-23 19:28:01 +03:00
P0lunin
053a946a34 added docs 2019-10-23 19:21:48 +03:00
P0lunin
e2cd5a8440 added generics into functions 2019-10-23 18:46:04 +03:00
P0lunin
f67011eb42 added CommandFilter 2019-10-23 18:36:53 +03:00
P0lunin
720a34932f divided TextFilter into MessageTextFilter and MessageCaptionFilter 2019-10-23 18:36:37 +03:00
P0lunin
03b0e41fa0 added test caption 2019-10-23 12:59:58 +03:00
P0lunin
ec11b9ed3a add MessageTextFilter 2019-10-23 12:56:44 +03:00
Temirkhan Myrzamadi
37ab5e049a Fmt 2019-10-22 17:02:43 +06:00
P0lunin
65320feaf0 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	src/dispatching/dispatchers/filter/mod.rs
2019-10-21 13:32:38 +03:00
P0lunin
b2a88e51eb replaced macro call! to function handle() 2019-10-21 13:30:17 +03:00
Temirkhan Myrzamadi
c611fce15b Fix 2019-10-20 23:21:47 +06:00
Temirkhan Myrzamadi
ecf2aec396 Fix all the errors 2019-10-20 23:06:12 +06:00
Temirkhan Myrzamadi
7268c39c88 Create dispatching.dispatchers 2019-10-20 22:53:33 +06:00
Temirkhan Myrzamadi
2bd8734482 Rename 'dispatcher' to 'dispatching' 2019-10-20 22:52:48 +06:00
Temirkhan Myrzamadi
e9f68c67e9 Rename dispatcher.simple to dispatcher.filter 2019-10-20 22:50:59 +06:00
Temirkhan Myrzamadi
089ff82b2d Rename Dispatcher to FilterDispatcher
Related to https://github.com/telebofr/telebofr/issues/59.
2019-10-20 22:48:05 +06:00
Temirkhan Myrzamadi
e1b3ba2227 Remove PartialOrd, Ord for True, False 2019-10-20 22:45:22 +06:00
Temirkhan Myrzamadi
480d1a6f57
Merge pull request #70 from telebofr/simple_dispatcher
attempt to replace macro to function
2019-10-20 16:40:39 +00:00
Temirkhan Myrzamadi
8bf578cf63
Merge pull request #69 from telebofr/false_type
false_type
2019-10-20 16:40:17 +00:00
Temirkhan Myrzamadi
1a87e72677 Fmt 2019-10-20 17:14:12 +06:00
RustemB
e80d4d5a62 some cahnges 2019-10-20 16:05:20 +05:00
RustemB
0a1d032e14 api.rs changed 2019-10-20 16:01:32 +05:00
RustemB
5916460ca1 +getChatAdministrators 2019-10-20 15:40:28 +05:00
RustemB
66147232e6 levaeChat 2019-10-20 12:30:07 +05:00
Temirkhan Myrzamadi
e0a278701d
Remove the unnecessary comment (bot/api.rs) 2019-10-20 01:33:45 +06:00
P0lunin
c85dc0fb68 added handle_message function 2019-10-19 21:11:36 +03:00
P0lunin
69096dc01d Revert "added handle_message function"
This reverts commit e7ef38c1
2019-10-19 21:06:36 +03:00
P0lunin
e7ef38c1b2 added handle_message function 2019-10-19 20:48:02 +03:00
P0lunin
281d01d1a2 tests were renamed 2019-10-19 20:08:09 +03:00
P0lunin
1e0f60bdef added True and False types 2019-10-19 20:02:27 +03:00
P0lunin
4a0e601063 added type False 2019-10-19 20:01:22 +03:00
P0lunin
4e2dfd6b06 Merge branch 'dev' of https://github.com/telebofr/telebofr into dev
# Conflicts:
#	src/bot/api.rs
#	src/requests/set_chat_title.rs
2019-10-19 18:50:10 +03:00
P0lunin
363259e416 added method setChatPermissions 2019-10-19 18:44:16 +03:00
P0lunin
6467f03978 added skip_serializing_if to Option<> fields 2019-10-19 18:43:52 +03:00
P0lunin
2cb5adeebe added method exportChatInviteLink 2019-10-19 18:17:07 +03:00
P0lunin
e760c281b8 added method setChatPhoto 2019-10-19 17:19:06 +03:00
P0lunin
85a81dbe52 fix wrong method_name 2019-10-19 17:00:45 +03:00
P0lunin
2a3d7cfbfb added method deleteChatPhoto 2019-10-19 17:00:14 +03:00
Temirkhan Myrzamadi
6f4bd19382 Import bot::Bot into lib.rs 2019-10-18 03:36:13 +06:00
Temirkhan Myrzamadi
715298c713 Merge branch 'dev' of https://github.com/telebofr/telebofr into dev 2019-10-18 03:20:38 +06:00
Temirkhan Myrzamadi
495e62e9aa Improve bot/mod.rs 2019-10-18 03:20:28 +06:00
P0lunin
351229a6c0 added method setChatTitle 2019-10-17 19:48:48 +03:00
Temirkhan Myrzamadi
ceaf36b101 Merge imports by default (rustfmt.toml) 2019-10-17 22:16:55 +06:00
Temirkhan Myrzamadi
852b89be88 Add the missing methods to Bot (bot/api.h) 2019-10-17 22:16:00 +06:00
Temirkhan Myrzamadi
8b4fbe4bb5
Merge pull request #67 from telebofr/issue_input_file
changed where necessary String to InputFile
2019-10-17 16:03:42 +00:00
P0lunin
f2cd6278fb changed where necessary String to InputFile 2019-10-17 18:44:34 +03:00
Temirkhan Myrzamadi
e8b402ea21
Merge branch 'dev' into requests_gymmasssorla 2019-10-17 15:41:34 +00:00
P0lunin
36976e098d changed where necessary String to InputFile 2019-10-17 18:36:03 +03:00
Temirkhan Myrzamadi
12d944aeb7 Add GetChatMembersCount 2019-10-17 21:13:50 +06:00
Temirkhan Myrzamadi
b3572072ad Add GetChatMember 2019-10-17 21:09:46 +06:00
P0lunin
21952b149a add method setChatDescription 2019-10-17 18:01:39 +03:00
Temirkhan Myrzamadi
82db9b18b2 Add SetChatStickerSet 2019-10-17 20:56:58 +06:00
Temirkhan Myrzamadi
6f28f28a4e Add DeleteChatStickerSet 2019-10-17 20:51:09 +06:00
Temirkhan Myrzamadi
0ac725ac18 Add AnswerCallbackQuery 2019-10-17 20:34:13 +06:00
Temirkhan Myrzamadi
2b679fed43 Fix a typo 2019-10-17 14:05:02 +06:00
Temirkhan Myrzamadi
07ad965562 Prettify src/requests.rs and src/types.rs 2019-10-17 14:02:36 +06:00
Temirkhan Myrzamadi
a3825d612d Provide &self instead of &&self (bot/api.h) 2019-10-17 13:33:26 +06:00
Temirkhan Myrzamadi
d0f8852533 Fix a typo 2019-10-17 13:25:53 +06:00
Temirkhan Myrzamadi
2fe88cbfe3 Fix some Clippy's lints 2019-10-17 10:46:42 +06:00
Temirkhan Myrzamadi
eee360792a Fix the errors 2019-10-17 10:41:18 +06:00
Temirkhan Myrzamadi
9b8f180a8a Format the sources 2019-10-17 10:37:37 +06:00
Temirkhan Myrzamadi
4ce7ceb831 Replace 'RequestContext' with 'Bot' 2019-10-17 10:36:30 +06:00
Temirkhan Myrzamadi
456c3226d7
Merge pull request #62 from telebofr/dispatcher_trait
Add dispatcher trait
2019-10-16 12:00:30 +00:00
Waffle
175e7572b2 Add dispatcher trait 2019-10-16 14:47:09 +03:00
Temirkhan Myrzamadi
87e04b491f Fix the errors 2019-10-15 23:21:02 +06:00
Temirkhan Myrzamadi
7d2d8f706d Add some documentation 2019-10-15 13:50:28 +06:00
Temirkhan Myrzamadi
76a10abc47 Rename Request::ReturnValue to Request::Output 2019-10-15 13:27:41 +06:00
Temirkhan Myrzamadi
4f17f23b69
Merge pull request #20 from WaffleLapkin/dispatcher
[WIP] Dispatcher impl
2019-10-15 05:38:26 +00:00
Waffle Lapkin
f8f133edea
Merge branch 'dev' into dispatcher 2019-10-15 00:24:22 +03:00
Waffle
0b7512e42c Remove main (ooops) 2019-10-15 00:22:39 +03:00
Waffle Lapkin
045dedf164
Merge branch 'dev' into remove_apply 2019-10-15 00:20:29 +03:00
Waffle
ec0c717593 Change visibility modifier of FormBuilder, FormValue, IntoFormValue from pub to pub(crate) 2019-10-15 00:12:33 +03:00
Waffle
04281bd80a A bunch of changes to multipart requests
- remove `FormBuilder::add_if_some`
- `FormBuilder::add` now work properly with `Option` and `InputFile`
- `FormBuilder::add_file` now accept `PathBuf` instead of `&PathBuf` and is used only in `SendMediaGroup::send`
- `ToFormValue` renamed to `IntoFromValue`
- `IntoFormValue::into_form_value` now accepts self by value and return `Option<FormValue>` instead of `String` (that gives `FormBuilder::add` abilities to work properly with `Option` and `InputFile`)
- `requests::utils::file_to_part` now accepts `PathBuf` instead of `&PathBuf`
- add `impl From<InputFile> for Option<PathBuf>`
- add `impl From<InputMedia> for InputFile`
- clean `{SendAudio,SendMediaGroup,SendPhoto}::send` code
2019-10-15 00:10:12 +03:00
Temirkhan Myrzamadi
186a3f0f8d
Merge branch 'dev' into generics 2019-10-14 16:00:52 +00:00
Temirkhan Myrzamadi
a526a55c7b
Merge pull request #53 from async-telegram-bot/message_getters
Add getters for all `Message` fields
2019-10-14 15:59:02 +00:00
Temirkhan Myrzamadi
32b854279d Use the 'value' name instead of 'chat_id'/etc 2019-10-14 21:46:08 +06:00
Waffle
b75a25cbd8 Add getters for all Message fields 2019-10-14 00:19:18 +03:00
Waffle
c466402594 Allow matching on bool for in src/types/unit_true.rs 2019-10-13 14:59:54 +03:00
Waffle
101630a3a1 Fix clippy "warning: you should consider deriving a Default implementation for types::inline_keyboard_markup::InlineKeyboardMarkup" 2019-10-13 14:44:21 +03:00
Waffle
77b24eaa3f Remove fn main from doctest (and also remove edition2018 cause I think it isn't useful)
Fix clippy "warning: needless `fn main` in doctest"
2019-10-13 14:39:53 +03:00
Waffle
d68ec00deb Elide lifetimes where possible.
Fix clippy "warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration)"
2019-10-13 14:17:23 +03:00
Waffle
cbd98f6e03 Fix clippy warning: methods called from_* usually take no self; consider choosing a less ambiguous name
(actually just allow that on the `from_chat_id` method cause it is setter for co-named field)
2019-10-13 14:03:56 +03:00
Waffle
53b9ab31c4 Fix clippy's warning: returning the result of a let binding from a block 2019-10-13 13:59:31 +03:00
Waffle
3999e6dbc8 Split request_multipart into self (that always accept Form) and request_simple, simplify SendMediaGroup::send 2019-10-13 13:32:59 +03:00
Waffle
815c8cdb7d Add InputFile::as{file,file_id,url} methods 2019-10-13 13:13:24 +03:00
Temirkhan Myrzamadi
16eb18809b Normalise src/requests 2019-10-13 14:17:55 +06:00