Dan
58482919ba
Make is_member field actually working
2019-05-05 12:24:37 +02:00
Dan
80081a29b4
Add supports_streaming attribute to the Video type
2019-04-30 14:43:57 +02:00
Joscha Götzer
d30cad1a2d
Use str or bytes for callback_data and CallbackQuery.data ( #241 )
2019-04-30 11:53:11 +02:00
Dan
cc9bc56391
Add important note to export_chat_invite_link
2019-04-30 11:29:54 +02:00
Dan
d83a2a951d
Revert "Fix export_chat_invite_link broken because of Layer update Fixes #244 "
...
This reverts commit 2aad5985
2019-04-30 11:22:23 +02:00
Dan
2aad59856d
Fix export_chat_invite_link broken because of Layer update
...
Fixes #244
2019-04-30 11:04:37 +02:00
Dan
94574efe2c
Remove unneeded method
2019-04-30 10:33:11 +02:00
Dan
63d76a7f13
Bring back automatic mime type detection for new uploads ( fixes #239 )
...
- Add mime.types file to contain a good database of type -> ext mappings
from svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
- Load mime.type at BaseClient creation and add two convenience methods
for guessing mime types from filenames and extensions from mime types,
guess_mime_type and guess_extension
- Make all send_* method as well as download_media use the new mime type
database via guess_mime_type and guess_extension methods
2019-04-20 18:56:30 +02:00
Dan
57be97566d
Make delete_messages return False when it fails to delete
...
This is because there will be no exception raised, because Telegram
is not sending any RPCError when you try to delete a message you don't
have rights on to.
2019-04-14 22:34:05 +02:00
Dan
b056aa8d7f
Add the field is_member to the ChatMember type
...
This can be used to find whether a restricted user is a member of the
chat at the moment of the request.
2019-04-14 21:08:33 +02:00
Dan
d6d2923e34
Add missing Poll docstrings in Message
2019-04-14 20:52:00 +02:00
Dan
5905f761fa
Add PollHandler type and on_poll decorator for handling Poll updates
2019-04-14 20:50:13 +02:00
bakatrouble
952f0627f1
Merge branch 'develop' into session_storage
...
# Conflicts:
# pyrogram/client/client.py
# pyrogram/client/ext/base_client.py
# pyrogram/client/ext/syncer.py
# pyrogram/client/style/html.py
# pyrogram/client/style/markdown.py
2019-04-14 21:49:45 +03:00
Dan
5c638e707e
Poll ids are now strings and not integers
2019-04-14 20:48:25 +02:00
Dan
cbc938931d
Rename forward_from_name to forward_sender_name
2019-04-14 20:34:46 +02:00
Dan
ebacefb6e0
Increase media thumbnail size limit
2019-04-14 20:33:45 +02:00
Dan
22a7e338ff
Fetch the pinned message in own chat (saved messages)
2019-04-14 20:18:44 +02:00
Dan
4661fb035b
Refactor Poll types and methods to reflect Bot API 4.2 docs
2019-04-14 20:17:42 +02:00
Dan
d2179e2ede
Fix Filters.video_note wrong name
2019-04-14 12:25:31 +02:00
Dan
1e635f00ea
Fix set_chat_description not working anymore with the new Layer
2019-04-13 16:10:15 +02:00
Dan
6ad9caa7c6
Automatically cast inline result ids to string
2019-04-13 15:54:19 +02:00
Dan
4d1abbbb79
Make the deprecation warning actually work
2019-04-13 14:41:14 +02:00
Dan
292a6ea7bf
Refactor the command filter.
...
Also allow it to work on media captions as well
2019-04-13 14:21:53 +02:00
Dan
88078d4573
Simplify user and chat filters implementation
2019-04-13 14:03:01 +02:00
Dan
05aed5e0e1
Clean up documentation pages
2019-04-12 15:52:06 +02:00
Dan
fbe6af2fc6
Automatically handle flood waits when using get_chat_members
2019-03-28 16:24:11 +01:00
Dan
e79f4fde80
Fix send_chat_action not working with upload_* actions
2019-03-28 14:01:38 +01:00
Dan
b4da453ef3
Documentation fixes
2019-03-27 14:46:02 +01:00
Dan
ef5dd96bdc
Fix broken mentions for both HTML and Markdown
2019-03-26 13:32:30 +01:00
Dan
b8341a9869
Remove delete_messages limitations
2019-03-25 11:34:47 +01:00
Dan
b5c6db6db0
Refactor project and move errors namespace out from pyrogram.api
2019-03-25 11:23:45 +01:00
Dan
066633ce45
Move dispatcher.py inside ext folder
2019-03-25 09:45:37 +01:00
Dan
ce0173e7cd
Add support for hidden users in forwarded messages
2019-03-24 18:51:04 +01:00
Dan
4b7c6810c0
Make get_sticker_set_name "private" with a leading underscore _
2019-03-22 13:33:47 +01:00
Dan
5edd971118
Update docs to use bot_token parameter
2019-03-22 12:39:15 +01:00
Dan
27666ec174
Small docs fixes
2019-03-22 12:14:31 +01:00
Dan
f0138ce555
Fix Inline buttons parsing
2019-03-22 11:58:49 +01:00
Dan
921800f902
Clean up docstrings
2019-03-22 11:53:25 +01:00
Dan
bc9f902376
Clean up inline-mode
2019-03-22 11:35:35 +01:00
Dan
fede74398c
Fix inline-mode branch breaking after many commits from develop
2019-03-21 18:37:00 +01:00
Dan
acbbfabb27
Merge branch 'develop' into inline-mode
...
# Conflicts:
# compiler/api/compiler.py
# compiler/error/source/400_BAD_REQUEST.tsv
# pyrogram/__init__.py
# pyrogram/client/dispatcher/dispatcher.py
# pyrogram/client/ext/utils.py
# pyrogram/client/methods/bots/__init__.py
# pyrogram/client/types/__init__.py
2019-03-21 17:40:49 +01:00
Dan
afcde95b30
Fix parsing ChannelForbidden; it doesn't have default permissions
2019-03-21 17:03:35 +01:00
Dan
41729cbdda
Fix argument not passed with name
2019-03-21 14:08:09 +01:00
Dan
159090483f
Update style
2019-03-21 14:04:46 +01:00
bakatrouble
081b9b280a
Add ability to forward messages as copies ( #227 )
...
* Add ability to forward messages as copies
* Add Messages.forward() method
* Update and clean up code
2019-03-21 13:53:07 +01:00
Eric Solinas
ac591cf3c7
Add more Message convenience methods ( #233 )
...
* Added convenience methods
message.reply_animation
message.reply_audio
message.reply_cached_media
message.reply_chat_action
message.reply_contact
message.reply_document
message.reply_game
message.reply_inline_bot_result
message.reply_location
message.reply_media_group
message.reply_photo
message.reply_poll
message.reply_sticker
message.reply_venue
message.reply_video
message.reply_video_note
message.reply_voice
message.edit_caption
message.edit_media
message.edit_reply_markup
message.pin
fixed send_document docstrings while doing so
uniformed function declaration of send_poll
* Update style and small fixes
2019-03-20 15:44:20 +01:00
bakatrouble
5aa93b8287
Show TOS on signup just once while program is running ( #231 )
2019-03-20 14:20:38 +01:00
Dan
3e18945f3c
Reformat code
2019-03-16 19:23:23 +01:00
Dan
9f26ac9cbe
Merge branch 'develop' into __slots__
2019-03-16 17:51:48 +01:00
Dan
def3bdaa63
Reformat code
2019-03-16 17:51:37 +01:00
Dan
34b51b6481
Force keyword arguments for all TL types
2019-03-16 16:53:52 +01:00
Dan
e0f1f6aaeb
Add __slots__ to every single Pyrogram types
2019-03-16 16:15:56 +01:00
Dan
ef9ed31589
Add __slots__ to PyrogramType and Update types
2019-03-16 16:15:56 +01:00
Dan
ad42b4c236
Add restrict_chat method
2019-03-13 14:48:55 +01:00
Dan
0c8b5f02fc
Make restrict_chat_member return Chat instead of a simple boolean
2019-03-13 14:48:30 +01:00
Dan
b01caf10a9
Rename default_permissions to just permissions
2019-03-13 14:47:39 +01:00
Dan
5be5446a77
Update restrict_chat_member with new permissions
2019-03-13 13:58:57 +01:00
Dan
b6038c4f2e
Update Chat and ChatPermissions to accommodate default chat permissions
2019-03-13 13:02:40 +01:00
Dan
8c9e5e6753
Fix PhotoSize parsing
2019-03-13 12:14:08 +01:00
Dan
a0e48572cb
Merge branch 'develop' into layer-95
2019-03-13 10:05:31 +01:00
Dan
90b959555d
Fix flood waits generated when iterating over basic chat members
2019-03-12 16:46:54 +01:00
Dan
b3ef53a29a
Add send_cached_media method
2019-03-11 21:26:07 +01:00
Dan
a4ea3f768c
Fix get_chat_member not working when passing "me" in basic groups
2019-03-04 12:56:47 +01:00
Dan
64775f5209
Fix "ModuleNotFoundError is not defined" error for Python <3.6
2019-03-04 12:50:42 +01:00
bakatrouble
85700b0ffc
Do not cache entities without access_hash
2019-03-01 21:23:53 +03:00
bakatrouble
8cc61f00ed
Fix threading with sqlite storage
2019-03-01 21:23:01 +03:00
Dan
ffa0da5800
Merge branch 'develop' into layer-95
...
# Conflicts:
# pyrogram/__init__.py
2019-03-01 18:38:27 +01:00
bakatrouble
f84f9ec4df
Add bot_token argument ( #221 )
...
* Add bot_token argument (closes #123 )
* Make session_name docs more readable and detailed
* Explicitely set is_bot=False
2019-03-01 18:30:39 +01:00
bakatrouble
87c4d08d9c
client.join_chat() now returns pyrogram.Chat instead of MTProto Update ( #206 )
...
* client.join_chat() now returns pyrogram.Chat instead of MTProto Update
* Do not use Chat._parse_mtproto_chat() method
* Update chat.py
Rename _parse_mtproto_chat to a generic _parse_chat_chat
Hint about its current usage (none).
2019-03-01 18:28:46 +01:00
bakatrouble
fda25f6534
Add client.set_username() method ( #208 )
...
* Add client.set_username() method
* Rename set_username() to update_user_username(); allow None as username
* Add client.update_chat_username() method
* Update update_chat_username.py
* Update update_user_username.py
Rename update_user_username to update_username
Add more details in docstrings
Fix style
* Rename update_user_username.py to update_username.py
* Update __init__.py
* Update 400_BAD_REQUEST.tsv
2019-03-01 18:06:17 +01:00
bakatrouble
5874e521ba
Merge remote-tracking branch 'pyrogram/develop' into session_storage
2019-03-01 19:43:02 +03:00
Dan
5294c21e97
Automatically coerce any text to string for keyboard buttons
2019-03-01 16:04:21 +01:00
bakatrouble
b0c011c70c
Fix plugins import on windows ( #223 )
...
Fixes #217
2019-02-27 22:27:50 +01:00
bakatrouble
033622cfb8
Cleanup json session storage specific code as it is used only for migrations
2019-02-27 22:49:23 +03:00
bakatrouble
10fc340eff
Add session migrating from json; add some indexes to sqlite sessions
2019-02-26 21:43:23 +03:00
bakatrouble
03b92b3302
Implement SQLite session storage
2019-02-26 21:06:30 +03:00
bakatrouble
260043d8ec
Unify peers cache
2019-02-26 19:24:00 +03:00
bakatrouble
5dc33c6337
add in-memory session storage, refactor session storages, remove mixin
2019-02-22 03:37:19 +03:00
bakatrouble
9c4e9e166e
Merge #221 , string sessions now work for bots too
2019-02-22 02:13:51 +03:00
bakatrouble
fd5889d69e
Merge branch 'bot_token_arg' into session_storage
...
# Conflicts:
# pyrogram/client/client.py
# pyrogram/client/ext/base_client.py
# pyrogram/client/ext/syncer.py
2019-02-22 01:59:21 +03:00
bakatrouble
5cc9a452eb
Add bot_token argument ( closes #123 )
2019-02-22 01:34:08 +03:00
bakatrouble
fd732add70
Refactor session storages: use session_name arg to detect storage type
2019-02-22 00:03:58 +03:00
bakatrouble
b04cf9ec92
Add string session storage
2019-02-21 21:43:57 +03:00
bakatrouble
431a983d5b
Fix logging and cleanup imports in client.py
2019-02-21 21:18:53 +03:00
bakatrouble
9d32b28f94
Implement extendable session storage and JSON session storage
2019-02-21 20:12:11 +03:00
Dan
50cff068a0
Fix send_* methods sending the incorrect Telegram media message type
...
This makes Pyrogram consistent with the official Bot API behaviour.
2019-02-12 20:29:05 +01:00
23rd
69f347ddec
Fixed loss of thumbnails after media editing. ( #216 )
2019-02-11 11:07:02 +01:00
Dan
23a40a45ca
Make get_contacts return a list of User objects
2019-02-06 11:28:57 +01:00
Dan
712b390f77
Add a retry mechanism when uploading chunks
2019-02-05 17:10:00 +01:00
Dan
a2263ad8ce
Make send_media_group return the new Messages object
2019-02-05 11:50:32 +01:00
Dan
6109129f73
Reword some filter docstrings to better explain their usages
2019-02-04 18:23:40 +01:00
Dan
a6dbed6dfb
Add a way to continue the update propagation within a group
...
Add continue_propagation() method and ContinuePropagation exception
Closes #212
2019-02-04 12:33:54 +01:00
Dan
ccecbd6a50
Merge branch 'raw-updates-swallowing' into develop
2019-02-04 11:47:31 +01:00
Dan
392fea6e32
Refactor Dispatcher's worker
...
Closes #211
2019-02-04 11:47:21 +01:00
Dan
429cfd0882
Move the check method into Handler superclass
2019-02-04 10:35:00 +01:00
Dan
249e405339
Update API schema to Layer 95
2019-02-03 11:03:11 +01:00
Dan
c40f061d9a
Fix CallbackQuery docstrings
2019-02-02 19:01:35 +01:00
Dan
f0d059da07
First working (and ugly) way for fixing raw updates being swallowed
2019-01-30 17:16:50 +01:00
Dan
628ddd4a25
Update Client's docstrings
2019-01-27 11:24:23 +01:00
Dan
67a35f8c7e
Handle get_history flood waits
...
It's likely to get triggered when using iter_history (every ~3k msgs)
2019-01-27 11:13:10 +01:00
Dan
a8a6f53e2d
Fix the configuration load process breaking in case of no plugins
2019-01-26 13:01:44 +01:00
Dan
66ed6d53e3
Merge branch 'smart-plugins-enhancements' into develop
2019-01-25 09:22:06 +01:00
Dan
68509638c1
Merge branch 'develop' into layer-93
2019-01-24 17:21:57 +01:00
Dan
44deabf399
Update iter_chat_members efficiency
2019-01-24 17:21:41 +01:00
Dan
56e7bc9962
Update kick*, promote*, restrict* and unban_chat_member methods
...
For Layer 93
2019-01-24 17:20:29 +01:00
Dan
e9b1730318
Update ChatMember to use the new ChatPermissions type
2019-01-24 17:05:15 +01:00
Dan
1472b8236d
Add ChatPermissions type
2019-01-24 17:03:51 +01:00
Dan
e99f86b69f
Update media thumbs parsing for L93
2019-01-21 18:45:52 +01:00
Dan
cb0b8ebeae
Fix Chat sticker_set_name
2019-01-21 18:35:11 +01:00
Dan
c0a5b0a2c3
Fix kicked members reporting "left" as status
2019-01-21 16:56:22 +01:00
Dan
b919ed8242
Add restricted_by attribute in ChatMember ( #204 )
2019-01-21 16:53:54 +01:00
Dan
f0c8f65e9d
Add promoted_by attribute in ChatMember ( #204 )
2019-01-21 16:41:56 +01:00
Dan
16b7203ee9
Add invite_by attribute in ChatMember ( #204 )
2019-01-21 16:34:46 +01:00
Dan
a57ee7b333
Accommodate parsing of invited_by attribute of ChatMember ( #204 )
2019-01-21 16:33:33 +01:00
Dan
d6a1503344
Add "date" attribute to ChatMember ( #204 )
2019-01-21 15:38:36 +01:00
Dan
76d4e4f60e
Fix "left" status not being parsed in ChatMember ( #204 )
2019-01-21 15:36:54 +01:00
Dan
be013de4d4
Fix plugins load via Client parameter
2019-01-16 20:25:48 +01:00
Dan
6ec3b12aeb
Smart plugins enhancements
2019-01-16 15:54:48 +01:00
Dan
3d16a715ad
Fix file using wrong line separator
2019-01-16 15:46:46 +01:00
Dan
6df7788379
Enhance proxy settings
...
- Allow proxy settings to omit "enabled" key
- Allow setting proxy to None in order to disable it
2019-01-16 13:10:01 +01:00
Dan
4e02cd23a8
Make all send_* methods dealing with files aware of StopTransmission
2019-01-11 14:13:23 +01:00
Dan
2791600926
Hint about the returned value in case of stopped downloads
2019-01-11 14:12:53 +01:00
Dan
b37d4dc7ec
Make get_file and save_file handle StopTransmission errors
2019-01-11 14:03:16 +01:00
Dan
6b63e88de7
Add Client.stop_transmission() method
...
As a wrapper for raise StopTransmission
2019-01-11 14:02:40 +01:00
Dan
c28b9f9a2c
Add StopTransmission custom exception
...
Useful for stopping up/downloads after they started
2019-01-11 14:00:03 +01:00
Dan
d5ed47f4e9
Fix Message.download() not working when using the progress callback
2019-01-11 13:59:18 +01:00
Dan
200ed844fe
Fix first_name and last_name not being called if they are callable
2019-01-11 13:02:19 +01:00
Dan
161ab79eb3
Add Filters.media_group for photos or videos being part of an album.
2019-01-11 12:51:01 +01:00
Dan
1d8fd0b836
Make Filters.regex work on message captions too
2019-01-11 12:46:41 +01:00
Dan
07276e31b9
Add restart method
2019-01-11 12:36:37 +01:00
Dan
19b8f648d2
Fix bad behaviours for Python <3.6
...
Pyrogram was relying on dict keys being "ordered"
(keys keeping insertion order).
2019-01-11 12:31:18 +01:00
Dan
66f70450aa
Allow phone_number, phone_code and password to also be functions
...
Also add recovery_code
References #163
2019-01-08 14:28:52 +01:00
Dan
8928ca3433
Rename game_score to game_high_score
2019-01-07 22:50:54 +01:00
Dan
ee472329a2
Move get_game_high_scores method into bots folder
2019-01-07 22:35:17 +01:00
Dan
dc737ab7bb
Add GameHighScore and GameHighScores types
2019-01-07 22:30:33 +01:00
Dan
633fefe178
Add get_game_high_scores method
2019-01-07 22:28:41 +01:00
Dan
65bdf31ce1
Move send_game and set_game_score into bots folder
2019-01-07 22:26:52 +01:00
Dan
33e83bf635
Update set_game_score docstrings
2019-01-07 22:19:21 +01:00
Dan
9771be9c2a
Add send_game and set_game_score methods
2019-01-07 21:49:58 +01:00
Dan
1bbf048b7a
Remove duplicated references
2019-01-07 21:49:25 +01:00
Dan
7ae9a065b8
Update examples
2019-01-07 10:34:38 +01:00
Dan
491b96c9f6
Use "recent" filter for up to 10k members
2019-01-07 10:00:42 +01:00
Dan
6451d599b2
Fix typo
2019-01-07 08:30:40 +01:00
Dan
bb27633da6
Add game and game_score in Message
2019-01-05 23:13:47 +01:00
Dan
50e5692eae
Add Filters.game and Filters.game_score. Also fix Filters.animation name
2019-01-05 23:12:59 +01:00
Dan
d5303285d6
Add support for Game inline buttons. Add CallbackGame type
2019-01-05 23:12:29 +01:00
Dan
7d061a1b5c
Add Game type
2019-01-05 23:11:39 +01:00
Dan
a50dba2b4c
Add close_poll method
2019-01-05 14:44:10 +01:00
Dan
7e354b12bf
Fix kick_chat_member docstrings and return type
2019-01-04 23:15:57 +01:00
Dan
b8a3d02eef
Fix get_messages return type
2019-01-04 23:12:06 +01:00
Dan
153439ac88
Add iter_chat_members method. Reference #170
2019-01-04 17:13:44 +01:00
Dan
d7e3397050
Update get_chat_members docstrings
2019-01-04 16:59:36 +01:00
Dan
e1cac13f0d
Fix get_dialogs docstrings
2019-01-04 16:58:57 +01:00
Dan
948f2b44ed
Add iter_dialogs method. Reference #170
2019-01-04 16:10:34 +01:00
Dan
4d1d70082b
Sleep in case of get_dialogs flood waits
2019-01-04 16:08:05 +01:00
Dan
8628d3a56d
Add iter_history method
...
For #170
2019-01-04 15:37:08 +01:00
Dan
fbc18cace0
Update get_history docstrings
2019-01-04 15:36:43 +01:00
Dan
04542dbddf
Make parsing multiple Messages more efficient
...
This is achieved by not calling get_messages for each single reply.
Instead, all the available replies are retrieved in one request only.
2019-01-04 14:42:39 +01:00
Dan
7e3513f8ee
Wait in case of flood errors in get_messages
2019-01-04 14:38:08 +01:00
Dan
fe89974523
Add get_history signature to BaseClient
...
Also make other method parameters generic
2019-01-04 14:37:26 +01:00
Dan
fe4e8c5a42
Rename get_history's "reversed" parameter to "reverse"
...
It was colliding with the built-in "reversed" function
2019-01-04 14:36:42 +01:00
Dan
36f987e979
Add Filters.me
...
Useful to filter messages coming from the current running user.
Does the same thing as Filters.user("me")
2019-01-03 20:58:38 +01:00
Dan
d69a93d253
Automatically cast message and caption arguments to str
2019-01-03 20:53:48 +01:00
Dan
4f6990d735
Add takeout parameter in Client
...
This lets the client use a takeout session instead of a normal one.
Takeout sessions are useful for exporting Telegram data. Methods invoked
inside a takeout session are less prone to throw FloodWait exceptions.
2019-01-03 12:20:42 +01:00
Dan
b53ba81a6a
Add no_updates parameter in Client
...
Useful to completely disable incoming updates for batch programs
2019-01-03 11:13:24 +01:00
Dan
372bbabe28
Make invite links of public channels work with get_chat
2019-01-02 22:39:16 +01:00
Dan
1f8f313398
Fix broken ChatMember parser working on already parsed Users
2019-01-02 19:13:01 +01:00
Dan
1960b00280
Add a way to stop iterating through handlers
...
Closes #125
2019-01-02 18:11:22 +01:00
Dan
f440b1f969
Add missing colon
2019-01-02 17:27:40 +01:00
Dan
4d7b1bafac
Update copyright year
2019-01-01 12:36:16 +01:00
Dan
21dbbc3f0b
Fix style parsers randomly returning "unsorted" dicts.
...
This is due to Python <3.6 having "unsorted" dicts. Dicts are inherently
unsorted, but starting from Python 3.6 they keep the order in which the
keys are inserted (useful for unpacking)
2018-12-31 17:13:50 +01:00
Dan
490b8bf579
Fix get_message getting infinite replies
2018-12-31 12:02:15 +01:00
Dan
5dcc19cfb3
Move download_media into messages and media namespace
2018-12-28 15:18:01 +01:00
Dan
64ec26850e
Document save_file
2018-12-28 15:16:46 +01:00
Dan
c907e8146a
Allow get_chat to work with chat invite links
2018-12-28 14:34:47 +01:00
Dan
0e62b3472a
Add get_chat_preview method and ChatPreview object
2018-12-28 14:26:00 +01:00
Dan
3814471af4
Change get_dialogs behaviour
...
It now accepts an offset_date instead of an offset_dialog
2018-12-27 23:56:45 +01:00
Dan
decaa9e7f0
Rename downwards to reversed
2018-12-27 23:55:56 +01:00
Dan
233e0920a2
Merge branch 'develop' into develop
2018-12-27 23:52:40 +01:00
Dan
1eee4b77e1
Pin/unpin_chat_message don't raise a ValueError anymore
2018-12-25 23:08:45 +01:00
Dan
7e4b96cfdf
Suppress PyPep8Naming soft-warnings
2018-12-25 16:20:09 +01:00
Dan
d91acfe2ca
Re-implement password-protected log-ins and support password recovery
2018-12-25 15:41:55 +01:00
Dan
fccadf526e
Merge branch 'develop' into future
...
# Conflicts:
# pyrogram/__init__.py
2018-12-25 14:36:59 +01:00
Dan
1e3612c781
Merge branch 'layer-85' into future
...
# Conflicts:
# compiler/api/source/main_api.tl
# pyrogram/client/methods/password/change_cloud_password.py
# pyrogram/client/methods/password/enable_cloud_password.py
# pyrogram/client/methods/password/remove_cloud_password.py
2018-12-25 14:34:56 +01:00
Dan
00e4e385aa
Allow bots to message old chats even if they don't exist in the session
2018-12-24 22:31:45 +01:00
Dan
6e964b51b1
Type hint on_message decorator
2018-12-24 14:50:04 +01:00
Dan
098b06d1b7
Fix poll docstrings and vote_poll wrong attribute access
2018-12-24 14:32:53 +01:00
Dan
c833b3842a
Put PollOption back in a separate file, its docstrings must be visible
2018-12-24 14:19:21 +01:00
Dan
c4280f017e
Add hide_via parameter to send_inline_bot_result
2018-12-24 14:13:47 +01:00
Dan
a551f1fe1e
Fix Filters.poll docstrings link to Poll type
2018-12-23 19:52:49 +01:00
Dan
1d676a76db
Merge branch 'develop' into future
2018-12-23 19:51:54 +01:00
Dan
9fe04ff7cd
Fix filter links to Objects
2018-12-23 19:51:45 +01:00
Dan
3fe7fb20be
Document retract_vote
2018-12-23 17:06:34 +01:00
Dan
2994929903
Document Poll
2018-12-23 17:00:51 +01:00
Dan
03d6c49d92
Document send_poll method
2018-12-23 17:00:51 +01:00
Dan
f477171344
Document vote_poll
2018-12-23 17:00:51 +01:00
Dan
03aa5094f7
Add retract_vote method
2018-12-23 17:00:51 +01:00
Dan
10f1e06326
Rework vote_poll to work with all polls generated by different clients
2018-12-23 17:00:51 +01:00
Dan
1f82eaa26f
Add vote_poll method
2018-12-23 17:00:51 +01:00
Dan
0ce7498f81
Parse the pinned message on basic chats too
2018-12-23 17:00:51 +01:00
Dan
2b568afd2a
Refactor Poll.
...
Move PollAnswer into poll.py and rename it to PollOption
2018-12-23 17:00:50 +01:00
Dan
2101dfb8db
Show a meaningful error and hint to read more when using cloud password
2018-12-23 01:09:20 +01:00
Dan
0371f4ce8b
Make cloud password methods raise NotImplementedError. See #178
...
The protocol changed (SRP) and they are currently not re-implemented.
2018-12-23 01:05:44 +01:00
Dan
7ee89c94cb
Update pin/unpin_chat_message
...
It is now possible to pin messages in basic groups as well as in the
own user's chat.
2018-12-23 01:00:31 +01:00
Dan
84fef9ecf1
Add missing file_reference argument where applicable
2018-12-23 00:55:00 +01:00
Dan
e669a6a9ae
Add send_poll method
2018-12-23 00:33:15 +01:00
Dan
8eab47123a
Add Filters.poll to filter Poll messages
2018-12-22 23:55:16 +01:00
Dan
2b25b9469b
Parse Poll objects inside Message
2018-12-22 23:55:04 +01:00
Dan
1ef3bc758f
Export Poll and PollAnswer types
2018-12-22 23:54:42 +01:00
Dan
aef02f049c
Add Poll and PollAnswer types
2018-12-22 23:54:18 +01:00
Dan
4bf6831be8
Fix some non-importable types for type hint
2018-12-22 11:22:58 +01:00
Dan
a0355a5cc4
Type hint all methods return values
2018-12-19 15:59:15 +01:00
Dan
bf0b947253
Type hint all Client methods
2018-12-19 14:55:48 +01:00
Dan
b593463bd7
Type hint all the remaining method parameters
2018-12-19 14:50:23 +01:00
Dan
4fb9969470
Replace Client with BaseClient type hint
2018-12-19 14:45:16 +01:00
Dan
5035daa9d7
Type hint all Pyrogram types
2018-12-19 13:29:58 +01:00
Dan
e8fbae3166
Make all parse methods protected to hide them from the lib user
2018-12-19 13:00:33 +01:00
Dan
b79f395d37
Type hint Message
2018-12-19 12:30:25 +01:00
Dan
26ef8ea953
Revert to the old style
2018-12-19 10:59:49 +01:00
Dan
510b2456b6
Reword offset_dialog docstrings in Dialog
2018-12-19 10:27:47 +01:00
Dan
8f6f38e0b0
Merge branch 'develop' into new-parsers
2018-12-18 11:22:47 +01:00
Dan
bc824f738c
Add extra warnings when sign-ins or sign-ups fail
2018-12-18 11:21:37 +01:00
Dan
c9bcf93cf7
Add extra checks in case sign-in or sign-up fails
2018-12-18 10:10:04 +01:00
Dan
e203a5500f
Don't treat messages containing web page previews as media
2018-12-18 10:07:40 +01:00
Dan
914dfca574
Reformat code and optimize imports
2018-12-18 09:50:39 +01:00
Dan
27052e31ca
Fix all those unresolved references caused by the refactor
2018-12-18 09:45:49 +01:00
Dan
dc2792fbea
Ditch raw attribute. There's no use for it now
2018-12-18 08:48:20 +01:00
Dan
761a07bda8
Remove unneeded parts in utils.py
2018-12-17 16:42:16 +01:00
Dan
1344e95be6
Use the new parsers in dispatcher.py
2018-12-17 16:40:06 +01:00
Dan
2a1a6301a6
Add Messages.parse_delete method
2018-12-17 16:37:58 +01:00
Dan
6a0a271d24
Fix broken UpdateStatus in case of incoming updates
2018-12-17 16:28:16 +01:00
Dan
1873344467
Update get_users to use the refactored User type
2018-12-17 16:27:16 +01:00
Dan
6bc2db7157
Better way of parsing total_count for Messages and UserProfilePhotos
2018-12-17 16:14:32 +01:00
Dan
e6dced80cf
Update get_dialogs to use the new refactored Dialogs type
2018-12-17 16:13:57 +01:00
Dan
ccf677f3a0
Refactor Dialog and Dialogs
2018-12-17 16:13:28 +01:00
Dan
8c02a1553d
Add Chat.parse_dialog
2018-12-17 16:12:53 +01:00
Dan
603bc88aa3
Refactor get_history method
2018-12-17 14:18:41 +01:00
Dan
7b90a0e7c5
Refactor Messages
2018-12-17 14:18:15 +01:00
Dan
5bc9e0fc75
Fix Video not having client and raw attributes set
2018-12-17 14:17:57 +01:00
Dan
8cbb9c9316
Refactor UserProfilePhotos
2018-12-17 13:51:08 +01:00
Dan
a683e3e917
Refactor bot keyboard types
2018-12-17 13:16:05 +01:00
Dan
3f643242b1
Reformat encoder style
2018-12-17 13:03:08 +01:00
Dan
d31a696f32
Fix encoder breaking with bytes
2018-12-17 13:02:22 +01:00
Dan
52b9319734
Refactor CallbackQuery
2018-12-17 13:01:41 +01:00
Dan
92118e3608
Reformat __init__ parameters
2018-12-17 12:45:35 +01:00
Dan
e9a362923f
Cache stickers
2018-12-17 12:42:29 +01:00
Dan
ac8258f451
Move Str into message.py
2018-12-17 12:40:32 +01:00
Dan
c6a0bf0791
Force named arguments on Pyrogram types
2018-12-16 22:34:23 +01:00
Dan
7430529646
Make use of the refactored Chat type in get_chat
2018-12-16 17:59:34 +01:00
Dan
5d64de10dc
Add Chat.parse_full
2018-12-16 17:58:32 +01:00
Dan
31b046e5cc
Use the refactored types in get_chat_member(s)
2018-12-16 17:58:05 +01:00
Dan
66cd896a99
Allow passing raw
2018-12-16 17:10:55 +01:00
Dan
cffafa8c61
Small fixed to PyrogramType
2018-12-16 17:10:08 +01:00
Dan
d62bc1d8ba
Refactor ChatMember and ChatMembers
2018-12-16 16:22:46 +01:00
Dan
3ecbb35470
Delete Update
2018-12-16 15:26:56 +01:00
Dan
6ab1c87050
Add PyrogramType
2018-12-16 15:24:51 +01:00
Dan
5ecbfbf25f
Refactor Message and MessageEntity
2018-12-16 14:30:44 +01:00
Dan
334fb8d0ba
Refactor Sticker, Contact and Document
2018-12-16 14:30:13 +01:00
Dan
c84fca30a2
Refactor Venue and Location
2018-12-16 14:29:10 +01:00
Dan
e5e0b17809
Refactor Photo and PhotoSize
2018-12-16 14:28:41 +01:00
Dan
11ed26b318
Refactor Animation, Video and VideoNote
2018-12-16 14:27:52 +01:00
Dan
905f4b8e62
Refactor Voice and Audio
2018-12-16 14:25:18 +01:00
Dan
efc6023b08
Re-implement remove_cloud_password using SRP
2018-12-15 20:08:31 +01:00
Dan
1c4dd13e72
Refactor Chat
2018-12-15 17:31:22 +01:00
Dan
5962f8dedc
Refactor ChatPhoto
2018-12-15 17:30:24 +01:00
Dan
bf3609ec0a
Refactor User
2018-12-15 17:29:51 +01:00
Dan
0d0fbdad27
Reformat UserStatus style
2018-12-15 17:28:52 +01:00
Dan
26b15f384d
Update UserStatus docs
2018-12-15 17:26:24 +01:00
Dan
b2f3e79ff7
Refactor UserStatus
2018-12-15 17:25:34 +01:00
Dan
9ac492e644
Remove Message generated comments
2018-12-15 15:32:50 +01:00
Dan
37d063e569
Reorganize Message __init__
2018-12-15 12:35:09 +01:00
Dan
40ecc082a6
Re-implement change_cloud_password using SRP
2018-12-15 12:22:33 +01:00
Dan
1bd41d0138
Fix CallbackQuery docs
2018-12-15 11:37:27 +01:00
Dan
47b25b0e2d
CallbackQuery must deal with bytes instead of strings
2018-12-15 11:36:16 +01:00
Dan
70470360b1
Print account name when logging in the first time
2018-12-15 11:10:25 +01:00
Dan
001a067d82
Make start and stop methods return self to make chaining possible
...
Suggestion by @CharlesBachman in Telegram
2018-12-15 09:50:35 +01:00
Dan
6a9c7312cc
Document how decorated functions are modified
2018-12-15 09:10:19 +01:00
Dan
e3459017ef
Re-implement enable_cloud_password using SRP
2018-12-15 09:05:50 +01:00
Dan
89983b75ca
Move relevant SRP-related code into another file
...
These functions are going to be used by all *_cloud_password methods
2018-12-15 08:59:26 +01:00
Dan
2ae8730b22
Add Filters.via_bot to filter messages sent via inline bots
2018-12-15 08:53:22 +01:00
Dan
4ba5e63034
Report offset instead of 0 in case file size is missing (for file_id)
2018-12-15 08:51:20 +01:00
Dan
9c91720104
Fix broken download_media progress args
2018-12-15 08:50:08 +01:00
Dan
49b18c600d
Add missing thumb for videos in albums. Fixes #169
2018-12-15 08:39:43 +01:00
Dan
0e050b45e7
Attempt srp
2018-12-15 08:06:18 +01:00
Dan
2a9149ca5f
Merge pull request #166 from zeroone2numeral2/webpage-message-attribute
...
Added Message.web_page and Filters.web_page
2018-12-08 16:43:48 +01:00
Dan
ac8fc58a06
Add a note hinting about basic support for web pages
2018-12-08 16:41:30 +01:00
zeroone2numeral2
2d1a7871ea
Added Filters.web_page
2018-11-25 17:05:59 +00:00
zeroone2numeral2
61f2d7c968
Added web_page attribute to Message object
2018-11-25 16:56:39 +00:00
Dan
436c48d1c2
Allow Bots to edit and delete own messages w/ Message bound methods.
...
This is some sort of a workaround because the server doesn't send full
info about text messages originated by bots. Fixes #162
2018-11-20 16:52:59 +01:00
Dan
b753e48732
Remove unnecessary check
2018-11-20 16:08:25 +01:00
Dan
08776619a7
Change callback_data type to bytes for request_callback_answer
...
Fixes #161
2018-11-20 16:08:24 +01:00
Aleksandr Pyatnitsin
40d7ed2b8e
fix RawUpdateHandler
2018-11-14 23:21:19 +03:00
Dan
e400641204
Fix Dispatcher bad behaviours in case of multiple Clients running at the same time.
2018-11-13 20:31:53 +01:00
Dan
5b10afa7a3
Small style fix
2018-11-13 13:30:26 +01:00
Dan
9f8e05861f
Fix sphinx warning
2018-11-13 13:22:23 +01:00
Dan
2e16499369
Allow decorators to be stacked
...
E.g:
app1.on_message(...)
app2.on_message(...)
app3.on_message(...)
def on_message(client, message):
...
2018-11-10 15:21:52 +01:00
Dan
fafa3b5131
Fix some decorators not working when used in plugins
2018-11-10 15:15:58 +01:00
Dan
97e705f833
Make new types importable
2018-11-09 13:16:44 +01:00
Dan
ebfb64e139
Add InputMessageContent docstrings
2018-11-09 13:16:27 +01:00
Dan
1ab17d8015
Fix InputTextMessageContent with empty reply markups
2018-11-09 13:15:54 +01:00
Dan
5ed904a2e4
Update inline_query_result_article
2018-11-09 13:15:20 +01:00
Dan
06797d32f0
Add InlineQueryResult super class
2018-11-09 13:09:27 +01:00
Dan
55cca00401
Add on_inline_query decorator
2018-11-09 13:08:50 +01:00
Dan
07cb14de61
Add InlineQueryHandler
2018-11-09 13:08:28 +01:00
Dan
755a392fa2
Merge branch 'develop' into inline-mode
2018-11-09 10:23:47 +01:00
Dan
c3edd9d862
Merge branch 'dispatcher-optimizations' into develop
2018-11-09 09:23:16 +01:00
Dan
23fd39e2c8
Update dispatcher.py
2018-11-09 09:21:01 +01:00
Dan
dfadf92742
Update InlineQueryResultArticle
...
Inherit from InlineQueryResult
2018-11-09 09:14:03 +01:00
Dan
b98345b20e
Add InputMessageContent type
2018-11-09 09:13:32 +01:00
Dan
c7fe5b810a
Add InlineQueryResult type
2018-11-09 09:13:20 +01:00
Dan
aaded7564e
Clean up auto generated comments
2018-11-09 08:54:54 +01:00
Dan
735246b259
Fix InlineQuery ID
2018-11-09 08:53:34 +01:00
Dan
8d50b86bc6
Merge branch 'develop' into inline-mode
...
# Conflicts:
# compiler/api/compiler.py
2018-11-09 08:52:26 +01:00
Dan
3adb820bac
Merge pull request #156 from VANKINEENITAWRUN/develop
...
Add missing args to Message.download bound method
2018-11-08 20:30:39 +01:00
Dan
80726784e5
Fix Filters.chat docstrings using unusual double quotes
2018-11-08 20:25:35 +01:00
Dan
803f36412f
Update Filters.user docstrings
2018-11-08 20:24:54 +01:00
Furoin
b4bc7deba0
added Filters.user("me")
2018-11-08 17:11:43 +03:00
Vankineeni Tawrun
cdabf3e7e0
added args to Message.download bound method
2018-11-08 19:08:56 +05:30
Dan
774462283e
Update service and media filter docstrings
2018-11-08 11:10:24 +01:00
Dan
f6d3db3662
Update docstring style
2018-11-08 11:03:47 +01:00
Dan
b747f87319
Update Filters.media
2018-11-08 10:50:52 +01:00
Dan
e760550f8b
Add Message.media field
2018-11-08 10:49:32 +01:00
Dan
f26e20d30e
Update Filters.service
2018-11-08 10:44:32 +01:00
Dan
fc7b77e2b9
Add Message.service field
2018-11-08 10:40:46 +01:00
Dan
32a09ffc4c
Add Message.empty field
2018-11-08 10:28:11 +01:00
Dan
f8844d60ab
Handle possible MESSAGE_IDS_EMPTY errors in case of pinned messages
2018-11-07 13:11:33 +01:00
Dan
648eb80928
Add Message.edit() bound method
2018-11-07 12:03:57 +01:00
Dan
160420bda4
Merge pull request #155 from Furoin/chat
...
Allow using "me" or "self" in Filters.chat
2018-11-06 17:41:12 +01:00
Dan
5efd608487
Update Filters.chat docstrings
2018-11-06 17:40:37 +01:00
Dan
5571888143
Add mentioned docstrings
2018-11-06 17:37:32 +01:00
Dan
0943761a91
Update filters.py
2018-11-06 17:32:46 +01:00
Dan
5da5cabf4c
Remove useless variable
2018-11-06 17:31:04 +01:00
Furoin
1adc812108
added Filters.chat("me")
2018-11-06 18:36:40 +03:00
Furoin
2d0ffcb0f4
added Filters.mentioned
2018-11-06 17:13:37 +03:00
Furoin
91beb214e9
added message.mentioned
2018-11-06 17:11:35 +03:00
Dan
ff7ee4678a
Catch possible MESSAGE_IDS_EMPTY errors
2018-11-04 17:25:39 +01:00
Dan
966926d383
Remove unneeded FloodWait check
2018-11-04 16:53:23 +01:00
Dan
46e19c395c
Don't encode callback data when sending inline buttons
2018-11-04 11:36:10 +01:00
Dan
af937152a1
Don't decode inline buttons callback data
...
Clients are able to set any value as plain bytes, this means UTF-8
decoding could fail.
2018-11-04 09:36:58 +01:00
Dan
30c0086fde
Fix missing total_count for ChatMembers in channels/supergroups
2018-11-03 22:01:26 +01:00
Dan
96af2ebcf2
Fix getattr failing for ChannelForbidden objects
2018-11-03 17:04:04 +01:00
Furoin
bc703ae6d7
added Filters.dan
2018-11-03 14:57:57 +03:00
Dan
c006ba5b30
Merge pull request #146 from TolichP/add-filesize-limit-error
...
Add file size limit error
2018-11-03 11:11:06 +01:00
Dan
09563067c7
Add a check for 0 B file sizes
2018-11-03 11:10:43 +01:00
Dan
45129658b0
Revisit docstrings
2018-11-03 10:49:11 +01:00
Dan
0c76774283
Reformat code
2018-11-02 10:26:59 +01:00
Dan
529ef143f0
Remove debugging piece of code
2018-10-28 19:52:54 +01:00
Dan
229b8df9cd
Fix bad behaviours of get_messages
2018-10-28 17:44:24 +01:00
Dan
005c24e4bd
Update get_messages docstrings
2018-10-28 17:24:37 +01:00
Dan
6cf6d49634
Update utils to accommodate changes on get_messages
2018-10-28 17:24:05 +01:00
Dan
daee188fa5
Update get_messages to accept the new reply_to_message_ids argument
2018-10-28 17:23:30 +01:00
Dan
39636f2843
Update get_messages signature
2018-10-28 17:18:00 +01:00
Dan
4fd93a790f
Small fixes and rewords
2018-10-28 15:27:49 +01:00
Dan
0a946033c3
Move optional field down after required fields
2018-10-28 15:27:20 +01:00
Dan
11b7c3b52a
Remove unused game field from Message
2018-10-28 15:26:46 +01:00
Dan
c9462911cf
Fix Filters.command ignoring commands with empty prefixes
2018-10-25 14:47:18 +02:00
Dan
99bdaae365
Allow nested folders for smart plugins
2018-10-23 15:43:49 +02:00
Dan
7d4dfa6d12
Merge branch 'delete-kicked-message' into develop
2018-10-21 09:51:12 +02:00
Dan
a0780d793d
Apply code review suggestions
2018-10-21 14:44:29 +07:00
Dan
bc08ba86d9
Update emojis
2018-10-21 09:43:57 +02:00
Dan
35e3471961
The restriction_reason field is not always available
2018-10-21 09:43:22 +02:00
Dan
1fe46610cd
Make plugins disabled by default
...
Users need to explicitly set plugins_dir parameter
2018-10-21 09:42:22 +02:00
Dan
b12c87f50a
Make kick_chat_member return the "user kicked" message
2018-10-21 09:40:49 +02:00
Alexandr
ee47c21eed
Add file size limit error
2018-10-19 23:39:29 +07:00
Dan
3f0a355f7e
Further optimize and simplify the Dispatcher
2018-10-19 11:54:27 +02:00
Dan
09e0345868
Small dispatcher clean ups
2018-10-18 21:18:22 +02:00
Dan
89362ef684
Tiny fix to reflect other docstrings
2018-10-18 11:48:55 +02:00
Dan
e88972a8f6
Add restriction_reason to User and Chat types. Closes #144
2018-10-18 11:10:37 +02:00
Dan
38ff950d01
Remove useless #noinspection
2018-10-17 21:00:14 +02:00
Dan
426cdbbcb8
Don't make use of Update objects when dispatching updates
...
The Update type is used nowhere, adds costly abstraction and makes the
code uglier. If I ever need it again (unlikely) I can just revert this.
2018-10-17 20:59:33 +02:00
Dan
a315c30336
Optimize dispatcher.py code
2018-10-17 20:37:53 +02:00
Dan
41180fd22a
Update max caption length
2018-10-16 15:24:54 +02:00
Dan
c8604e8e2c
Update on_user_status decorator
2018-10-16 12:58:11 +02:00
Dan
9e159a3f50
Merge branch 'plugins' into develop
2018-10-16 12:12:21 +02:00
Dan
8a81bd1221
Merge branch 'user-status' into develop
2018-10-16 12:07:53 +02:00
Dan
c7a38655c4
Merge branch 'update-profile-photo' into develop
2018-10-16 11:59:17 +02:00
Dan
841141077f
Add better examples to Filters.command
2018-10-16 11:53:05 +02:00
Dan
22998af784
Fix docstrings
2018-10-16 11:45:39 +02:00
Dan
29201674ef
Rename delete_profile_photos to delete_user_profile_photos
...
For consistency with other method names
2018-10-16 11:45:20 +02:00
Dan
8fc5b8a545
Rename set_profile_photo to set_user_profile_photo
2018-10-16 11:43:54 +02:00
Dan
c94c79edac
Implement InlineQueryResultCachedAudio
2018-10-16 11:34:44 +02:00
Dan
797a0df087
Implement InlineQueryResultPhoto
2018-10-15 15:04:49 +02:00
Dan
c8fc995c83
No need to inherit from Object
2018-10-15 14:31:16 +02:00
Dan
0a057cc233
Expose new types and methods
2018-10-15 14:30:12 +02:00
Dan
350265aaae
Add answer_inline_query method
2018-10-15 14:29:58 +02:00
Dan
c5cedd880d
Allow Markdown and HTML styles to work on an empty dict.
...
For inline results. User mentions are disabled this way
2018-10-15 14:29:23 +02:00
Dan
e59d07af1e
Add missing InlineQueryResultArticle
2018-10-15 14:28:11 +02:00
Dan
59c3aa0589
Inject reply_markup
2018-10-15 14:25:02 +02:00
Dan
d6c0e61456
Add InputTextMessageContent type
2018-10-15 14:24:33 +02:00
Dan
dd642f5b9d
Add scraped inline query results
2018-10-15 11:34:27 +02:00
Dan
93018a7f6c
Add set_profile_photo method
2018-10-15 11:03:07 +02:00
Dan
c37dcb07cf
Add parse_inline_query util method
2018-10-15 10:50:17 +02:00
Dan
a9fe0fffc6
Add InlineQuery type
2018-10-15 10:48:07 +02:00
Dan
5b17376801
Enable dispatching of user status updates
2018-10-15 10:18:22 +02:00
Dan
d567b878b1
Expose UserStatusHandler and on_user_status
2018-10-15 10:17:00 +02:00
Dan
2eae08aaa6
Add on_user_status decorator
2018-10-15 10:16:19 +02:00
Dan
ff9be53a95
Add UserStatusHandler class
2018-10-15 10:14:40 +02:00
Dan
471b5c3334
Add user_status field to Update class
2018-10-15 10:10:49 +02:00
Dan
4b04910197
Add user_id field to UserStatus
2018-10-15 10:08:56 +02:00
Dan
79a9ddfab5
Some more changed in order to enhance UserStatus API design
2018-10-15 10:07:46 +02:00