Commit Graph

424 Commits

Author SHA1 Message Date
Krishna-singhal
0825b977ea
Add bound method Message.react (#937)
* Bound method `react` to send reaction

* Update message.py

* Update message.py

* Update compiler.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2022-03-28 21:03:37 +02:00
Dan
7bfcd5ac5f Revamp bot commands and bot command scopes
Closes #777
2022-03-28 13:23:12 +02:00
Nick
8d7b62654c
Update API schema to Layer 139 (#936) 2022-03-11 12:14:59 +01:00
Sam
54f8ca25fb
Add 400 CHANNEL_ADD_INVALID error (#894)
* Add RPC Error: CHANNEL_ADD_INVALID

* Update 400_BAD_REQUEST.tsv

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2022-02-13 11:37:43 +01:00
Gor
d9d7a867b5
Add 406 CHANNEL_PRIVATE error (#899) 2022-02-13 11:37:14 +01:00
Dan
b676297ca9 Update API schema to Layer 138 2022-02-01 11:36:46 +01:00
Dan
b9424c7455 Add ChatJoinRequest bound methods docs 2022-02-01 11:01:02 +01:00
Dan
aaaa97c77a Document ApiCallError RPC error 2022-01-31 21:28:51 +01:00
Dan
333d22afca Update API schema to Layer 137 2022-01-29 14:45:35 +01:00
Dan
a6299f8401 Use a proper condition check when dealing with flag vectors
When reading flag vectors, non-existent vectors are being translated
to [] (empty list). When writing them, the flag condition was
strictly checking for None and an empty list [] would result in an
empty vector being serialized, which should not happen.
Related to #871.
2022-01-11 17:24:17 +01:00
Dan
527ec23c20 Revert reading non-existent flag vectors from None to [] 2022-01-11 16:59:08 +01:00
Sam
de9705f126
Fix core types and compiler (#871)
- Add missing ID to FutureSalts
- Have vector flags read to None instead of [] for non-existent lists
2022-01-11 16:40:37 +01:00
Dan
626a1bd938 Update copyright year 2022-01-07 10:23:45 +01:00
Dan
8c8288412f Various improvements 2022-01-07 10:18:51 +01:00
Dan
80d0966691 Merge branch 'set-chat-protected-content' 2022-01-07 09:51:47 +01:00
Dan
ac3d2b8d7a Rename methods and add proper docs 2022-01-05 12:50:44 +01:00
Fernando Werneck
b283bce262
Add No Forwards chat option (#839)
* Add No Forwards chat option

* Fix chat.py
2022-01-05 12:37:25 +01:00
Dan
46d3d8aaf6 Update REACTION_INVALID error message 2021-12-30 13:39:58 +01:00
Dan
42c690757d Update API schema to Layer 136 2021-12-30 08:57:02 +01:00
Dan
9a2bc25bc7 Add support for "send_as" chats
- Add methods get_send_as_chats() and set_send_as_chat()
- Add field Chat.send_as_chat
2021-12-23 16:53:03 +01:00
Dan
e8076d1b8a Add method get_discussion_message 2021-12-22 15:00:03 +01:00
Dan
2024b3c120 Rename kick(ed) occurrences to ban(ned) 2021-12-22 14:39:52 +01:00
Dan
7d917f43e5 Add approve/decline_chat_join_request 2021-12-22 14:12:57 +01:00
David Hu
419ecb1af5
Add RPC Error: CHAT_FORWARDS_RESTRICTED (#825)
* Add RPC Error: CHAT_FORWARD_RESTRICTED

* Fix the typo in the previous commit

Sorry, made a typo in the error name

* Update 400_BAD_REQUEST.tsv

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2021-12-20 20:40:32 +01:00
Dan
ca29ea1db4 Update API schema to Layer 135 2021-11-26 18:03:17 +01:00
Dan
a460d12a82 Update API schema to Layer 134 2021-11-10 10:23:10 +01:00
Dan
362441a74a
Update API schema to Layer 133 (patch) 2021-09-25 10:02:19 +02:00
Dan
eec7ec3947
Update API schema to Layer 133 2021-09-10 19:46:38 +02:00
Dan
320696b4b2
Update API schema to Layer 132 2021-08-31 21:59:23 +02:00
餅喵
4d933b80f9
Fix TL schema naming conflicts (#690)
* Avoid variable conflicts with Telegram TL schema

* Fix game button with no data attached to button

* Update combinator.txt

* Update compiler.py

* Update tl_object.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2021-08-28 10:01:12 +02:00
Dan
6745c9d815 Update API schema to Layer 131 2021-07-25 12:46:39 +02:00
Dan
3d6ec570f3 Update API schema to Layer 130 2021-07-10 09:43:14 +02:00
Dan
8845b976ab
Fix docs (#699) (#703)
* Fix docs (#699)

* typo fixing

* Update inline_query_result_video.py

* layer update 129 (commits)

* fixes

* Update main_api.tl

* Update main_api.tl

Co-authored-by: BelgenOp <76117511+BelgenOp@users.noreply.github.com>
2021-06-23 17:01:06 +02:00
Dan
3dde55db39 Update API schema to L129 (patch) 2021-06-20 08:48:38 +02:00
Dan
ab63abe6fd Update API schema to Layer 129 2021-06-06 11:52:01 +02:00
Dan
aef0cce8d9 Add more RPC errors 2021-05-14 17:31:36 +02:00
Dan
dd32854db4 Squashed commit of the following:
commit d6dcf98d7445cbdc2a036deca57207c14bc354fc
Author: Dan <14043624+delivrance@users.noreply.github.com>
Date:   Wed May 12 09:35:18 2021 +0200

    Rename get_chat_onlines to get_chat_online_count

commit 21ff2a39d856ebc939ce9b15810198c82a9c23c6
Merge: 808c629f 29701a3a
Author: Dan <14043624+delivrance@users.noreply.github.com>
Date:   Wed May 12 09:32:59 2021 +0200

    Merge branch 'master' into get-chat-online-count

commit 808c629f43b185bc0df8337a82f5ecc860bbdb94
Author: Andriel Rodrigues <andrielkogama2@gmail.com>
Date:   Wed May 12 04:28:53 2021 -0300

    Add get_chat_online_count method (todo) (#654)
2021-05-12 09:39:51 +02:00
Jonathan
293e852afd
Add new method set_bot_commands (#657)
* a new method set_bot_commands

* Delete bot_commands_list.py

* Update set_bot_commands.py

* Update __init__.py

* Update set_bot_commands.py

* Update set_bot_commands.py

* Update bot_command.py

* Update set_bot_commands.py

* Update set_bot_commands.py

* Update compiler.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2021-05-11 10:22:17 +02:00
Danipulok
429b871171
Add method Client.copy_media_group (#592)
* Add method client.copy_media_group

* -updated wrong variable names

* Replace  with

* Update copy_media_group.py

* Update copy_media_group.py

* Update compiler.py

* Update copy_media_group.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2021-05-09 12:39:49 +02:00
Dan
89860a4b4c Add VoiceChatScheduled type and Message.voice_chat_scheduled field 2021-04-26 16:56:10 +02:00
Dan
c13230cb81 Merge branch 'layer-128' 2021-04-26 16:07:56 +02:00
Dan
416c351f6b Update API schema to Layer 128 2021-04-12 21:16:34 +02:00
Dan
9a8bf9d1dc Fix wrongly generated class names 2021-04-12 09:28:58 +02:00
Dan
b6f97ee924 Add support for signed error codes 2021-04-12 09:19:50 +02:00
Dan
da697aec13 Fix messed up method names 2021-03-21 22:42:16 +01:00
Dan
b1dc0315a1 Update API schema to Layer 126 2021-03-21 21:52:37 +01:00
Dan
c971616808 Add add_contact, improve delete_contacts and import_contacts 2021-03-20 10:13:40 +01:00
Dan
3445507a9a Update types.rst 2021-03-20 07:41:49 +01:00
Dan
2d785acdc7 Add Message.edit and Message.reply to docs 2021-03-19 20:42:48 +01:00
Dan
54ad043a70 Add get_chat_invite_link method 2021-03-18 18:33:11 +01:00
Dan
b6613fbd63 Update API schema to Layer 125 (patch) 2021-03-17 20:38:00 +01:00
Dan
182768a5d3 Add support for LoginUrl buttons 2021-03-17 17:13:55 +01:00
Dan
dff3d993e1 Add support for updates about chat member status changes 2021-03-17 15:11:23 +01:00
ColinShark
ee5f39374c
Add support for the improved Invite Links (#639)
* Add new invite link export methods

* Implement higher-level Invite type

* Update Docstrings and rename Invite

* Docstrings are now more consistent with other methods
* Invite is now InviteLink to be less arbitrary

* Add method to get exported links

* `get_exported_chat_invites`
* prepare `__init__` for the other InvitesV2 methods

* Update returned type

`str` -> `types.InviteLink`

* Add method to edit invite link

Since editing the link returns a slightly different type to exporting,
I have made a small "hack" in the InviteLink type.

* Move Invites V2 methods to their own namespace

* Add get_chat_invite_importers and InviteImporter

Method to fetch information on users that joined via a specific link and
the type to display the information

* Add methods to delete revoked links

* delete_exported_chat_invite to delete a single revoked link
* delete_revoked_exported_chat_invites to delete all revoked links of a
specified admin

* Renaming Invite(s) to InviteLink(s)

As per @delivrance's request
https://github.com/pyrogram/pyrogram/pull/630#issuecomment-791893890

Also sorted invites' __init__ alphabetically

* Add Method to get admins with exported invite link

Documentation needs an update and the respective type needs to be
created. I cannot test this, as I lack Creator permissions.

* Invite Links overhaul

* Rearrange code

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2021-03-17 12:40:36 +01:00
Dan
4f16c174a3 Add one more 5xx error 2021-03-14 12:39:17 +01:00
Dan
4afedd7ba6 Update errors list 2021-03-14 12:37:13 +01:00
Dan
31148c3a56 Update API schema to Layer 125 2021-03-14 12:25:17 +01:00
Dan
6daa501972 Add a friendly interface for getting chat event logs
Add get_chat_event_log method
Add ChatEvent and ChatEventFilter types
2021-03-06 10:22:19 +01:00
Dan
e390aea86e Enable docs for Message.get_media_group 2021-02-27 18:56:28 +01:00
Dan
5dabeeafbb Update API schema to Layer 124 2021-02-23 13:04:10 +01:00
Dan
9f5179863a Update API schema (Layer 123 patch) 2021-02-12 21:21:23 +01:00
Dan
c3819ddb56 Update API schema to Layer 123 2021-01-28 13:03:39 +01:00
Dan
3c992e8f86 Add missing Message.unpin docs 2021-01-12 22:25:19 +01:00
Dan
d28db96128 Add new errors 2021-01-03 20:56:47 +01:00
Dan
7dda167c09 Update copyright notice
Year 2021
2021-01-01 22:58:48 +01:00
Dan
91ec6ebf1b Merge branch 'develop' of https://github.com/pyrogram/pyrogram
 Conflicts:
	pyrogram/methods/chats/__init__.py
	pyrogram/methods/chats/mark_chat_unread.py
2020-12-26 22:07:12 +01:00
Dan
3d971fb577 Allow passing False instead of None for optional flag-boolean parameters
Previously, passing anything that was not None would result in the boolean
flag being set to True, even when passing False. This will make it simpler
to deal with optional flag-boolean values in the raw API.
2020-12-25 12:16:20 +01:00
Dan
3ca90b84c7 Update API schema (Layer 122 patch, again) 2020-12-22 19:57:21 +01:00
Legenda24
e1dac6c0e2
Add new method get_media_group (#550)
* Update __init__.py

Support for GetMediaGroup

* Create get_media_group.py

Added new method - get_media_group

* Update get_media_group.py

Add pyro stuff

* Update get_media_group.py

* Update compiler.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2020-12-20 17:02:54 +01:00
Dan
503327c864 Update API schema (Layer 122 patch) 2020-12-14 17:33:05 +01:00
ColinShark
04cf4e68e3
Add mark_chat_unread() method (#322)
* Add mark_chat_unread() method

* Add bound method for mark_chat_unread

* Update mark_chat_unread.py

* Update chat.py

Apply Dans suggested changes

* Update mark_chat_unread.py

* Update chat.py

* Update compiler.py

Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com>
2020-12-12 16:56:26 +01:00
Dan
5cbe03e89e Update API schema to Layer 122 2020-12-08 22:25:11 +01:00
Dan
2f3bcd7ee5 Add Message.copy bound method 2020-12-05 01:54:07 +01:00
Dan
7325daf870 Add new method: copy_message 2020-12-05 01:35:24 +01:00
Dan
de0b215f8d Add a missing method to docs and move one to the correct space 2020-12-02 17:27:04 +01:00
Dan
8f71527bbd Update errors 2020-12-02 17:00:42 +01:00
Dan
a2d7da1f59
Fix Illegal quoting 2020-11-24 16:11:13 +01:00
Dan
bf7bd45f1c Fix compiled errors destination path 2020-11-20 02:04:24 +01:00
Dan
1b42fb7f77 Rename "error" package to "errors" 2020-11-13 17:59:41 +01:00
Dan
6a8741124d Sort errors, add sort.py script for future sorts 2020-11-13 17:58:10 +01:00
Dan
f3b96e889f Add extra errors 2020-11-13 17:49:27 +01:00
Dan
ebf2d68386 Add new method unpin_all_chat_messages 2020-11-08 13:21:40 +01:00
Dan
31f9772917 Update API schema to Layer 120 2020-10-30 19:50:29 +01:00
Dan
a18e0242fa Fix raw API not being properly imported when using repr/eval
Fixes #423
2020-08-30 11:17:20 +02:00
Dan
22d9077e2b Warn users in case they try to use base types as arguments 2020-08-29 15:12:45 +02:00
Dan
d385aae1d2 Types don't need to inherit from TLObject 2020-08-27 14:20:30 +02:00
Dan
bab9359df8 Use a better way to document properties 2020-08-26 09:07:54 +02:00
Dan
c5dd474f93 Document undocumented properties 2020-08-26 08:10:34 +02:00
Dan
303712f599 Update docs 2020-08-22 16:09:38 +02:00
Dan
538f1e3972 Deep rewrite: preparing for v1.0
- Pyrogram core is now fully asynchronous
- Ditched Python 3.5, welcome 3.6 as minimum version.
- Moved all types to pyrogram.types
- Turned the Filters class into a module (filters)
- Moved all filters to pyrogram.filters
- Moved all handlers to pyrogram.handlers
- Moved all emoji to pyrogram.emoji
- Renamed pyrogram.api to pyrogram.raw
- Clock is now synced with server's time
- Telegram schema updated to Layer 117
- Greatly improved the TL compiler (proper type-constructor hierarchy)
- Added "do not edit" warning in generated files
- Crypto parts are executed in a thread pool to avoid blocking the event loop
- idle() is now a separate function (it doesn't deal with Client instances)
- Async storage, async filters and async progress callback (optional, can be sync too)
- Added getpass back, for hidden password inputs
2020-08-22 08:05:05 +02:00
Dan
b745ce95ed Remove set_chat/profile_video 2020-07-27 15:03:23 +02:00
Dan
293e63008b Add set_chat_video method 2020-07-27 13:42:27 +02:00
Dan
66e7573730 Add new RPC errors 2020-07-27 13:42:05 +02:00
Dan
2034a785f4 Add set_profile_video method 2020-07-27 13:00:31 +02:00
Dan
e5fda6f9a0 Update API schema to Layer 116 2020-07-26 12:28:15 +02:00
Alisson Lauffer
531069b1e2
Some fixes and speed improvments (#439)
* Use raw string for re pattern

* Trim trailing whitespaces from docstrings and code

* Use isinstance() instead of type() for typechecking

* Remove unused imports
2020-07-12 06:43:30 +02:00
Dan
db7fc68efe
Update FILE_PART(S)_INVALID error message
Telegram now allows uploads up to 2000 MiB in size (4000 parts)
2020-07-06 16:01:37 +02:00
Dan
d65f773ed9 Update API schema to Layer 114 2020-06-05 10:03:10 +02:00
Dan
d5a18eb063 Add search_global method 2020-05-23 14:50:14 +02:00
Dan
fd4bd754cc Add missing update_profile to docs and Client 2020-05-02 21:16:52 +02:00