Lonami Exo
b8912ea0aa
Add two MEDIA_*_INVALID to known errors
2018-11-30 21:54:00 +01:00
Lonami Exo
8eca29be25
Make use of the new method info when generating docs
2018-11-30 21:48:15 +01:00
Lonami Exo
f05109f186
Update code generator to parse CSV files
2018-11-30 21:39:13 +01:00
Lonami Exo
f646863149
Replace error and method data with CSV files
2018-11-30 21:38:36 +01:00
Lonami Exo
c70943bb0e
Add CHAT_RESTRICTED to known errors
2018-11-03 12:46:19 +01:00
Ivan Tung
c248a102dc
Fix-up 99129da
error generation if error.has_captures ( #1025 )
2018-10-21 15:22:46 +02:00
Lonami Exo
f51b56558d
Document AUTH_KEY_DUPLICATED, better assistant UX
2018-10-19 19:32:17 +02:00
Lonami Exo
477fbd8dc7
Generate simple examples for the docs
2018-10-16 09:29:48 +02:00
Lonami Exo
8f04ec820f
Don't add functions as possible argument types
2018-10-15 21:12:10 +02:00
Lonami Exo
bb180a1db8
Split generator/tlobject into separate files
2018-10-15 19:29:32 +02:00
Lonami Exo
e3c4bd46fb
Reference argument types to objects when parsing .tl
2018-10-15 19:23:09 +02:00
Lonami Exo
99129daeee
Show the request that caused RPC errors in their messages
2018-10-15 18:35:51 +02:00
Lonami Exo
ee4c952290
Add descriptions for new RPC errors
2018-10-15 17:57:16 +02:00
Lonami Exo
0fcc2e5e52
Add autocast for InputDocument and InputChatPhoto
2018-10-05 14:11:47 +02:00
Lonami Exo
ec0aa65fe1
An user -> a user
2018-09-22 19:18:42 +02:00
Lonami Exo
cb6f980277
Better autocast to InputPeerDialog and documentation
2018-09-22 10:56:37 +02:00
Lonami Exo
497c2144f2
Fix patched objects missing CONSTRUCTOR_ID/SUBCLASS_OF_ID
2018-09-17 16:02:45 +02:00
Lonami Exo
6b57dba5e1
Fix-up f25541e
(.to_dict() on patched objects)
2018-08-09 11:16:36 +02:00
Lonami Exo
f25541ea6f
Make .to_dict() work on invalid TLObjects
...
This will improve logging from the previous commit as well.
2018-08-08 12:12:00 +02:00
Lonami Exo
e3bf6e3330
Document reply markup limits
2018-08-07 12:46:05 +02:00
Lonami Exo
200a4e47b8
Clarify some strings
2018-07-25 02:21:44 +02:00
Lonami Exo
61a9f1e61c
Create a third module to store patched objects
2018-07-22 19:12:09 +02:00
Lonami Exo
5017a9d1da
Fix typos and add the URL_INVALID error
2018-07-14 10:43:24 +02:00
Lonami
8ca2e56aee
Fix ID autocast should not add the mark
2018-07-07 19:42:47 +02:00
Lonami Exo
61f9dc1cd7
Fix-up missing parenthesis from 066004a
2018-07-07 13:03:46 +02:00
Lonami Exo
066004acd1
Support chat_id autocast
2018-07-07 12:53:46 +02:00
Lonami Exo
5d4b8a283d
Don't generate def resolve() for types
...
This would require nested resolving which could be quite
expensive. Instead there will just be a single level for
resolve() and it will belong in the requests.
2018-07-07 12:17:29 +02:00
Lonami Exo
bd878acbde
Support InputNotifyPeer autocast
2018-07-07 12:14:03 +02:00
Lonami Exo
baedd10110
Update to layer 82
2018-06-29 13:23:56 +02:00
Lonami Exo
dd0eb7a90e
Explicitly open files as 'r' instead of leaving it out
2018-06-29 11:34:57 +02:00
Lonami Exo
a1799ee74b
Use localStorage for the selected theme in the docs
2018-06-27 10:36:56 +02:00
Lonami Exo
e604960a1d
Include TAKEOUT_INIT_DELAY_X in the available errors
2018-06-27 09:46:14 +02:00
Lonami Exo
1da0018a5d
Update to layer 81 (again)
2018-06-26 11:36:59 +02:00
Lonami Exo
58031b3adf
Update to layer 81
2018-06-24 11:37:54 +02:00
Lonami Exo
f614d3836b
Finish up asyncio docs
2018-06-22 14:44:59 +02:00
Lonami Exo
9c0a22ddd7
Fix Python 3.5 compatibility
2018-06-20 20:18:16 +02:00
Lonami Exo
4e9a84c3b5
Remove underscore from module names
2018-06-18 21:02:42 +02:00
Lonami Exo
fbf3bf119c
Separate errors needing regex from those which don't
2018-06-18 19:09:45 +02:00
Lonami Exo
463847ad50
Revisit and remove a few TODOs
2018-06-18 18:46:06 +02:00
Lonami
bb3a564500
Merge pull request #843 from LonamiWebs/core-rewrite
...
Core rewrite
2018-06-14 16:25:28 +02:00
Lonami Exo
f3f0c28505
Support converting .tl -> .json
2018-06-13 10:48:35 +02:00
Lonami Exo
3f16c92eb3
Subclass TLRequest for content-related objects
2018-06-12 20:14:21 +02:00
Lonami Exo
0c25bf29b4
Add missing parenthesis
2018-06-11 13:43:08 +02:00
Jeff
cea75a4365
Adds new docs index for methods can be used as bots ( #840 )
2018-06-11 13:36:32 +02:00
Lonami Exo
3e151a1b7a
Make TelegramBareClient able to invoke requests
2018-06-09 21:03:48 +02:00
Lonami Exo
f7e8907c6f
Create RpcResult class and generalise core special cases
...
This results in a cleaner MTProtoSender, which now can always
read a TLObject with a guaranteed item, if the message is OK.
2018-06-09 13:13:55 +02:00
Lonami Exo
56b09c0c9d
Properly set future results
2018-06-07 10:30:20 +02:00
Lonami Exo
4bdc28a775
Show invalid bot methods in the docs
2018-06-06 17:35:06 +02:00
Lonami Exo
c7d7977951
Fetch invalid bot methods from pwrtelegram
2018-06-06 17:03:49 +02:00
Lonami Exo
e93b8f2b13
Update to layer 80 and accept TOS on sign_up ( #824 )
2018-06-03 13:26:51 +02:00
Lonami Exo
ae87d452c8
Clean-up docs and merge some imports
2018-05-30 18:55:01 +02:00
Lonami Exo
6726eab045
Clean-up DocsWriter
2018-05-24 11:48:15 +02:00
trgwii
c4c41645e7
Improved modular JS for the docs ( #813 )
2018-05-24 11:22:52 +02:00
Lonami Exo
1aa3fbb295
Add easter egg theme for the docs
2018-05-23 19:49:43 +02:00
Lonami Exo
8e2b28cf27
Fix docs generating top level empty folders
2018-05-23 18:50:40 +02:00
Lonami Exo
c3e5d390eb
Add optional dark theme for the docs
2018-05-23 18:50:28 +02:00
Lonami Exo
bb0d29bdd5
Fix unboxed serialization including constructor ID
...
This only affected FutureSalts, but it's useful that it behaves
the way it should. cc @JuanPotato for spotting the bug.
2018-05-22 19:21:01 +02:00
Lonami Exo
32b7e9e27a
Whitelist generator's mismatching ID and ya username
2018-05-12 16:12:42 +02:00
Lonami Exo
5440593520
Update to layer 78
2018-05-12 15:51:37 +02:00
Lonami Exo
55c09cde97
Fix online documentation showing duplicated errors
2018-05-06 18:16:48 +02:00
Lonami Exo
ee0f95b156
Fix library expects bytes instead strings on mtproto.tl
2018-05-06 13:06:44 +02:00
Lonami Exo
7ba044730d
Fix "Other X with this type" missing from the docs
2018-04-28 12:21:55 +02:00
Lonami Exo
08dbc42718
Update to layer 76
2018-04-28 11:49:43 +02:00
Lonami Exo
3008ada98d
Distinguish between mtproto/telegram TL like tdlib does
2018-04-28 10:19:55 +02:00
Lonami Exo
f31ca142a3
Support autocast to InputMessage
2018-04-23 11:05:38 +02:00
Lonami Exo
6328e032e4
Fix local URLs on the generated docs
2018-04-15 14:59:07 +02:00
Lonami Exo
3ed81481f8
Enhance setup.py gen command
2018-04-15 13:19:25 +02:00
Lonami Exo
6058b80877
Further clean-up of the documentation generator
2018-04-15 12:15:43 +02:00
Lonami Exo
5b5edff624
Remove special case from documentation's formatter
2018-04-15 11:54:34 +02:00
Lonami Exo
b88a2ef208
Reuse more code to get class names
2018-04-15 11:47:33 +02:00
Lonami Exo
c18971da54
Add a new section in the docs listing known RPC errors
2018-04-15 11:18:26 +02:00
Lonami Exo
d0fb371515
Fix some documentation methods misusing relative paths
2018-04-15 10:59:04 +02:00
Lonami Exo
d924f97b58
Fix relative paths when generating documentation
2018-04-15 10:47:55 +02:00
Lonami Exo
1f8316c0bb
Fix import errors for the documentation generator
2018-04-14 21:15:58 +02:00
Lonami Exo
daebf5b7e8
Move docs generator into the telethon_generator package
2018-04-14 20:35:05 +02:00
Lonami Exo
3b7c4fe278
Further TLObject generator clean-up
...
Split everything into several functions, reused some more
common code (like accessing the "real" arguments instead
constantly filtering) and more, like using classmethods
instead staticmethods and then hardcoding the class name.
2018-04-14 20:28:25 +02:00
Lonami Exo
748f2db23d
Fix wrong camel case for all names
2018-04-14 19:04:07 +02:00
Lonami Exo
70f5af44de
Move data to its own subdirectory
2018-04-14 18:20:29 +02:00
Lonami Exo
0af4699994
Move tl_generator to generators/ and remove the class
2018-04-14 18:17:59 +02:00
Lonami Exo
200d3c0360
Clean-up unused methods and reuse more common utils
2018-04-14 17:22:39 +02:00
Lonami Exo
ab15f3699f
Clean-up the TLObject class/parser from redundant comments
2018-04-14 16:05:09 +02:00
Lonami Exo
fc1bc05ca1
Move tlobject and source_builder into their correct folders
2018-04-14 15:16:13 +02:00
Lonami Exo
463fcedf27
Split error_generator code into parsers/generators packages
2018-04-14 13:56:39 +02:00
Lonami Exo
8b2afa3530
Separate error fetching from generation
2018-04-14 13:21:27 +02:00
Lonami Exo
cb226e7f45
Revisit telethon_generator ( closes #724 )
2018-04-01 12:46:44 +02:00
Lonami Exo
7bc021bba4
Update to layer 75 (again)
2018-03-30 20:28:07 +02:00
Lonami Exo
500792975e
Handle AUTH_KEY_DUPLICATED on connection
2018-03-30 12:18:18 +02:00
Tulir Asokan
935de0afbb
Add Python type hints to attributes of TL types ( #678 )
2018-03-12 10:58:56 +01:00
Lonami Exo
2e31a686e8
Upgrade to layer 75
...
Captions are now "messages" and also support message entities.
2018-03-02 21:28:33 +01:00
Lonami Exo
39621ceae9
Use req_pq_multi instead req_pq when creating an auth_key
2018-02-19 20:31:47 +01:00
Dmitry D. Chernov
55bcc29ae0
Errors: Fix passing 'self' to the constructors of the superclasses
...
This is necessary only if the superclass name is specified explicitly instead of super() call.
2018-02-14 17:09:22 +10:00
Lonami Exo
7286f77008
Sort keys and use Mozilla agent on error generator, update file
2018-01-28 14:02:42 +01:00
Lonami Exo
2873dcf1c6
Add '_' key to TLObject's .to_dict() and remove recursive param
...
Closes #559
2018-01-25 09:44:07 +01:00
Lonami Exo
0e43022959
Remove redundant import, show type instead TLObject on docstring
2018-01-19 13:40:04 +01:00
Lonami Exo
33e50aaee1
Reuse .on_response/.__str__/.stringify, override iff necessary
2018-01-19 12:12:52 +01:00
Lonami Exo
1c9fa76ede
Add new method to .resolve() parameters instead on init
...
TLObject's __init__ used to call utils.get_input_* methods and
similar to auto-cast things like User into InputPeerUser as
required. Now there's a custom .resolve() method for this purpose
with several advantages:
- Old behaviour still works, autocasts work like usual.
- A request can be constructed and later modified, before the
autocast only occured on the constructor but now while invoking.
- This allows us to not only use the utils module but also the
client, so it's even possible to use usernames or phone numbers
for things that require an InputPeer. This actually assumes
the TelegramClient subclass is being used and not the bare version
which would fail when calling .get_input_peer().
2018-01-19 11:47:45 +01:00
Lonami Exo
eaef392a9b
Add and except missing FLOOD_TEST_PHONE_WAIT_X error
2018-01-10 17:34:34 +01:00
Lonami Exo
6eef6f5d23
Update to layer 74
2018-01-02 00:02:31 +01:00
Lonami Exo
3537e9bcc9
Support more types to represent a date
2017-12-28 12:32:16 +01:00
Lonami Exo
b11c2e885b
Fix assertion for multiple same flag parameters
2017-12-25 18:00:24 +01:00
Lonami Exo
9c66f0b2b4
Fix empty strings not working as expected for flag parameters
2017-12-24 15:15:19 +01:00
Lonami Exo
d515ede7da
Fix TLParser not stripping inline comments
2017-11-30 13:34:55 +01:00
Lonami Exo
a1c669333e
Update scheme to layer 73
2017-11-15 12:22:37 +01:00
Lonami Exo
d59b17c6fc
Clear up confusing error and trailing brace ( closes #429 )
2017-11-14 09:48:40 +01:00
Lonami Exo
e8248b4b8b
Remove now unused Emoji ranges generator
2017-11-06 09:37:07 +01:00
Lonami Exo
1e35c1cfed
Update to layer 72
2017-11-04 13:40:43 +01:00
Lonami Exo
f5fafc6a27
Enhance emoji detection
2017-10-29 16:41:30 +01:00
Lonami Exo
2f28050cac
Fix generated __bytes__ failing with flag indicator but no flags
...
Likely since the code was ported to get rid of the BinaryWriter,
since the flag calculation was inlined. Some types (only
channelMessages as of layer 71) had a flag indicator but no flag
arguments, so the calculation of which were not None failed.
This special case is now handled correctly.
2017-10-28 11:09:55 +02:00
Andrei Fokau
e6ac61c1b9
Add missing __init__.py to telethon_generator package ( #382 )
2017-10-25 19:48:46 +02:00
Lonami Exo
e427559d4c
Fix username invalid error having wrong username regex
2017-10-25 12:22:38 +02:00
Lonami Exo
b3ca68b7d9
Avoid cyclic imports caused by #348 ( fix #357 )
2017-10-24 10:07:31 +02:00
Lonami Exo
5f0faee013
Attempt at fixing redundant import from ee01724
( #357 )
2017-10-22 11:12:42 +02:00
Joscha Götzer
9937d58a2d
Remove f-strings from codegen to support py <3.6 ( #366 )
2017-10-21 00:43:26 +02:00
Lonami Exo
be9358282a
Generate and fetch new errors from setup.py
2017-10-20 17:29:45 +02:00
Lonami Exo
38ccd6d1d9
Generate errors from PWRTelegram's API
2017-10-20 17:20:05 +02:00
Lonami Exo
0e1249c833
Fix incorrectly generated code
2017-10-19 10:42:09 +02:00
Lonami Exo
f49208f961
Fix assert condition on generated code with flags involved
...
The specific case was SendMessageRequest with
InputMessageEntityMentionName, failing with bot/bot_info
2017-10-18 20:43:46 +02:00
Lonami Exo
adb79b21cf
Replace .to_bytes() with the special .__bytes__ function
2017-10-17 19:54:59 +02:00
Viktor Oreshkin
ee01724cdb
Fix parsing for constructors and not objects ( #348 )
2017-10-16 20:15:22 +02:00
Viktor Oreshkin
1b71c6fbf1
Fix vector regex in parser ( #347 )
2017-10-16 19:19:16 +02:00
Lonami Exo
83677fc927
Enhance and use .get_input_photo on the generated code
2017-10-08 13:45:14 +02:00
Lonami Exo
91a5d20e93
Replace .on_response with static .from_reader for all types
2017-10-07 13:26:09 +02:00
Lonami Exo
06bb09b95c
Fix wrong .empty() due to variable shadowing (from ce48c97
)
2017-10-01 10:45:59 +02:00
Lonami Exo
ce48c9752e
Assert flag params with same flag index are all set/unset
2017-09-30 19:47:19 +02:00
Lonami Exo
afc4bd9cab
Rename constructor/subclass_of_id to upper case, keep only static
2017-09-29 13:11:33 +02:00
Lonami Exo
a4fa652d35
Precompute the flag index on the generated code
2017-09-29 13:03:35 +02:00
Lonami Exo
76d14b2dd9
Make generated .to_bytes() more readable
2017-09-29 13:00:22 +02:00
Lonami Exo
195bba6f21
Fix bug where booleans were always serialized as false
2017-09-29 12:57:53 +02:00
Lonami Exo
423efc4360
Fix optional vector arguments failing
2017-09-29 11:56:43 +02:00
Lonami Exo
4bedbfe945
Use bytes instead string type on the auth-key methods
2017-09-28 10:32:57 +02:00
Lonami Exo
14791e1df1
Fix wrong type hint for int128 and int256
2017-09-28 10:12:39 +02:00
Lonami Exo
748c2560de
Fix auto-generated code didn't actually write int128/int256
2017-09-28 10:12:15 +02:00
Lonami Exo
fb0898b9cb
Don't distinguish between str and bytes when serializing
...
This makes it easier to use some requests like ReqPqRequest which
needs a string of bytes, not a valid utf-8 string per se.
2017-09-28 09:55:29 +02:00
Lonami Exo
9b7733d6b9
Avoid the use of starred expressions on autogen code ( fix #266 )
2017-09-27 12:05:35 +02:00
Lonami Exo
b83cd98ba0
Replace TLObject.on_send with the new .to_bytes()
...
This also replaces some int.to_bytes() calls with a faster
struct.pack (up to x4 faster). This approach is also around
x3 faster than creating a BinaryWriter just to serialize a
TLObject as bytes.
2017-09-26 14:36:02 +02:00
Lonami Exo
b40708a8c7
Import get_input_* only once on the generated code
2017-09-25 14:05:13 +02:00
Lonami Exo
dc73744fc4
Add get_input_media calls on the generated code
2017-09-25 13:47:25 +02:00
Lonami Exo
1593a4415e
Fix None datetime being type hinted as invalid
2017-09-23 20:07:40 +02:00
Lonami Exo
5701029fbf
Stop treating .to_dict() with no args as a special case
2017-09-23 10:59:08 +02:00
Lonami Exo
0b48b1ec8a
Add support for non-recursive TLObject.to_dict()
2017-09-23 10:41:36 +02:00
Lonami Exo
81d4d76d16
Fix generated code showing the incorrent type hint for datetime
2017-09-19 13:20:34 +02:00
Lonami Exo
f7e4f3f678
Make type hinting on the generated code more IDE-friendly
2017-09-18 21:00:06 +02:00
Lonami Exo
2595d45bd7
Import os only once on the generated code
2017-09-18 20:23:03 +02:00
Lonami Exo
2c5c674531
Stop using TLObject.__repr__ to show the TL definition
2017-09-18 20:19:39 +02:00
Lonami Exo
b14a7d9e68
Revert layer being a property
2017-09-17 16:19:53 +02:00
Lonami Exo
aea10b103b
Rename generated layer variable to uppercase readonly property
2017-09-17 16:17:55 +02:00
Lonami Exo
3a5eab2e83
Fix infering random_id lists failing for ForwardMessages
2017-09-12 10:32:11 +02:00
Lonami Exo
97cab7347b
Make lint happier
2017-09-04 17:10:04 +02:00
Lonami Exo
0e45f46ad5
Properly ignore core types when generating code
2017-09-04 16:38:03 +02:00
Lonami Exo
e8cdcf369d
Sort generated code by name for more predictable results
2017-09-04 15:11:46 +02:00