Skip to content

Commit aade032

Browse files
committed
Methodology Updates
1 parent 4a1873e commit aade032

2,330 files changed

Lines changed: 6296 additions & 2482 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyrogram/errors/exceptions/all.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
count = 768
19+
count = 769
2020

2121
exceptions = {
2222
420: {
@@ -66,6 +66,7 @@
6666
"CHAT_SEND_STICKERS_FORBIDDEN": "ChatSendStickersForbidden",
6767
"CHAT_SEND_VIDEOS_FORBIDDEN": "ChatSendVideosForbidden",
6868
"CHAT_SEND_VOICES_FORBIDDEN": "ChatSendVoicesForbidden",
69+
"CHAT_SEND_WEBPAGE_FORBIDDEN": "ChatSendWebpageForbidden",
6970
"CHAT_TYPE_INVALID": "ChatTypeInvalid",
7071
"CHAT_WRITE_FORBIDDEN": "ChatWriteForbidden",
7172
"EDIT_BOT_INVITE_FORBIDDEN": "EditBotInviteForbidden",

pyrogram/errors/exceptions/forbidden_403.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,13 @@ class ChatSendVoicesForbidden(Forbidden):
194194
MESSAGE = __doc__
195195

196196

197+
class ChatSendWebpageForbidden(Forbidden):
198+
"""You can't send web pages in this chat."""
199+
ID = "CHAT_SEND_WEBPAGE_FORBIDDEN"
200+
"""``str``: RPC Error ID"""
201+
MESSAGE = __doc__
202+
203+
197204
class ChatTypeInvalid(Forbidden):
198205
"""The specified chat type is invalid."""
199206
ID = "CHAT_TYPE_INVALID"

pyrogram/raw/all.py

Lines changed: 56 additions & 23 deletions
Large diffs are not rendered by default.

pyrogram/raw/base/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,4 +402,13 @@
402402
from .profile_tab import ProfileTab
403403
from .input_chat_theme import InputChatTheme
404404
from .star_gift_upgrade_price import StarGiftUpgradePrice
405+
from .group_call_message import GroupCallMessage
406+
from .group_call_donor import GroupCallDonor
407+
from .recent_story import RecentStory
408+
from .auction_bid_level import AuctionBidLevel
409+
from .star_gift_auction_state import StarGiftAuctionState
410+
from .star_gift_auction_user_state import StarGiftAuctionUserState
411+
from .star_gift_auction_acquired_gift import StarGiftAuctionAcquiredGift
412+
from .star_gift_active_auction_state import StarGiftActiveAuctionState
413+
from .input_star_gift_auction import InputStarGiftAuction
405414
from . import help, storage, auth, contacts, messages, updates, photos, upload, account, channels, payments, phone, stats, stickers, users, chatlists, bots, stories, premium, smsjobs, fragment
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
# # # # # # # # # # # # # # # # # # # # # # # #
20+
# !!! WARNING !!! #
21+
# This is a generated file! #
22+
# All changes made in this file will be lost! #
23+
# # # # # # # # # # # # # # # # # # # # # # # #
24+
25+
from typing import TYPE_CHECKING, Union
26+
27+
from pyrogram import raw
28+
from pyrogram.raw.core import BaseTypeMeta
29+
30+
31+
if TYPE_CHECKING:
32+
AuctionBidLevel = Union[raw.types.AuctionBidLevel]
33+
else:
34+
# noinspection PyRedeclaration
35+
class AuctionBidLevel(metaclass=BaseTypeMeta): # type: ignore
36+
"""This base type has 1 constructor available.
37+
38+
Constructors:
39+
.. hlist::
40+
:columns: 2
41+
42+
- :obj:`AuctionBidLevel <pyrogram.raw.types.AuctionBidLevel>`
43+
"""
44+
45+
QUALNAME = "pyrogram.raw.base.AuctionBidLevel"
46+
__union_types__ = Union[raw.types.AuctionBidLevel]
47+
48+
def __init__(self):
49+
raise TypeError("Base types can only be used for type checking purposes: "
50+
"you tried to use a base type instance as argument, "
51+
"but you need to instantiate one of its constructors instead. "
52+
"More info: https://docs.kurigram.live/telegram/base/auction-bid-level")
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
# # # # # # # # # # # # # # # # # # # # # # # #
20+
# !!! WARNING !!! #
21+
# This is a generated file! #
22+
# All changes made in this file will be lost! #
23+
# # # # # # # # # # # # # # # # # # # # # # # #
24+
25+
from typing import TYPE_CHECKING, Union
26+
27+
from pyrogram import raw
28+
from pyrogram.raw.core import BaseTypeMeta
29+
30+
31+
if TYPE_CHECKING:
32+
GroupCallDonor = Union[raw.types.GroupCallDonor]
33+
else:
34+
# noinspection PyRedeclaration
35+
class GroupCallDonor(metaclass=BaseTypeMeta): # type: ignore
36+
"""This base type has 1 constructor available.
37+
38+
Constructors:
39+
.. hlist::
40+
:columns: 2
41+
42+
- :obj:`GroupCallDonor <pyrogram.raw.types.GroupCallDonor>`
43+
"""
44+
45+
QUALNAME = "pyrogram.raw.base.GroupCallDonor"
46+
__union_types__ = Union[raw.types.GroupCallDonor]
47+
48+
def __init__(self):
49+
raise TypeError("Base types can only be used for type checking purposes: "
50+
"you tried to use a base type instance as argument, "
51+
"but you need to instantiate one of its constructors instead. "
52+
"More info: https://docs.kurigram.live/telegram/base/group-call-donor")
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
# # # # # # # # # # # # # # # # # # # # # # # #
20+
# !!! WARNING !!! #
21+
# This is a generated file! #
22+
# All changes made in this file will be lost! #
23+
# # # # # # # # # # # # # # # # # # # # # # # #
24+
25+
from typing import TYPE_CHECKING, Union
26+
27+
from pyrogram import raw
28+
from pyrogram.raw.core import BaseTypeMeta
29+
30+
31+
if TYPE_CHECKING:
32+
GroupCallMessage = Union[raw.types.GroupCallMessage]
33+
else:
34+
# noinspection PyRedeclaration
35+
class GroupCallMessage(metaclass=BaseTypeMeta): # type: ignore
36+
"""This base type has 1 constructor available.
37+
38+
Constructors:
39+
.. hlist::
40+
:columns: 2
41+
42+
- :obj:`GroupCallMessage <pyrogram.raw.types.GroupCallMessage>`
43+
"""
44+
45+
QUALNAME = "pyrogram.raw.base.GroupCallMessage"
46+
__union_types__ = Union[raw.types.GroupCallMessage]
47+
48+
def __init__(self):
49+
raise TypeError("Base types can only be used for type checking purposes: "
50+
"you tried to use a base type instance as argument, "
51+
"but you need to instantiate one of its constructors instead. "
52+
"More info: https://docs.kurigram.live/telegram/base/group-call-message")

pyrogram/raw/base/input_invoice.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030

3131
if TYPE_CHECKING:
32-
InputInvoice = Union[raw.types.InputInvoiceBusinessBotTransferStars, raw.types.InputInvoiceChatInviteSubscription, raw.types.InputInvoiceMessage, raw.types.InputInvoicePremiumAuthCode, raw.types.InputInvoicePremiumGiftCode, raw.types.InputInvoicePremiumGiftStars, raw.types.InputInvoiceSlug, raw.types.InputInvoiceStarGift, raw.types.InputInvoiceStarGiftDropOriginalDetails, raw.types.InputInvoiceStarGiftPrepaidUpgrade, raw.types.InputInvoiceStarGiftResale, raw.types.InputInvoiceStarGiftTransfer, raw.types.InputInvoiceStarGiftUpgrade, raw.types.InputInvoiceStars]
32+
InputInvoice = Union[raw.types.InputInvoiceBusinessBotTransferStars, raw.types.InputInvoiceChatInviteSubscription, raw.types.InputInvoiceMessage, raw.types.InputInvoicePremiumAuthCode, raw.types.InputInvoicePremiumGiftCode, raw.types.InputInvoicePremiumGiftStars, raw.types.InputInvoiceSlug, raw.types.InputInvoiceStarGift, raw.types.InputInvoiceStarGiftAuctionBid, raw.types.InputInvoiceStarGiftDropOriginalDetails, raw.types.InputInvoiceStarGiftPrepaidUpgrade, raw.types.InputInvoiceStarGiftResale, raw.types.InputInvoiceStarGiftTransfer, raw.types.InputInvoiceStarGiftUpgrade, raw.types.InputInvoiceStars]
3333
else:
3434
# noinspection PyRedeclaration
3535
class InputInvoice(metaclass=BaseTypeMeta): # type: ignore
36-
"""This base type has 14 constructors available.
36+
"""This base type has 15 constructors available.
3737
3838
Constructors:
3939
.. hlist::
@@ -47,6 +47,7 @@ class InputInvoice(metaclass=BaseTypeMeta): # type: ignore
4747
- :obj:`InputInvoicePremiumGiftStars <pyrogram.raw.types.InputInvoicePremiumGiftStars>`
4848
- :obj:`InputInvoiceSlug <pyrogram.raw.types.InputInvoiceSlug>`
4949
- :obj:`InputInvoiceStarGift <pyrogram.raw.types.InputInvoiceStarGift>`
50+
- :obj:`InputInvoiceStarGiftAuctionBid <pyrogram.raw.types.InputInvoiceStarGiftAuctionBid>`
5051
- :obj:`InputInvoiceStarGiftDropOriginalDetails <pyrogram.raw.types.InputInvoiceStarGiftDropOriginalDetails>`
5152
- :obj:`InputInvoiceStarGiftPrepaidUpgrade <pyrogram.raw.types.InputInvoiceStarGiftPrepaidUpgrade>`
5253
- :obj:`InputInvoiceStarGiftResale <pyrogram.raw.types.InputInvoiceStarGiftResale>`
@@ -56,7 +57,7 @@ class InputInvoice(metaclass=BaseTypeMeta): # type: ignore
5657
"""
5758

5859
QUALNAME = "pyrogram.raw.base.InputInvoice"
59-
__union_types__ = Union[raw.types.InputInvoiceBusinessBotTransferStars, raw.types.InputInvoiceChatInviteSubscription, raw.types.InputInvoiceMessage, raw.types.InputInvoicePremiumAuthCode, raw.types.InputInvoicePremiumGiftCode, raw.types.InputInvoicePremiumGiftStars, raw.types.InputInvoiceSlug, raw.types.InputInvoiceStarGift, raw.types.InputInvoiceStarGiftDropOriginalDetails, raw.types.InputInvoiceStarGiftPrepaidUpgrade, raw.types.InputInvoiceStarGiftResale, raw.types.InputInvoiceStarGiftTransfer, raw.types.InputInvoiceStarGiftUpgrade, raw.types.InputInvoiceStars]
60+
__union_types__ = Union[raw.types.InputInvoiceBusinessBotTransferStars, raw.types.InputInvoiceChatInviteSubscription, raw.types.InputInvoiceMessage, raw.types.InputInvoicePremiumAuthCode, raw.types.InputInvoicePremiumGiftCode, raw.types.InputInvoicePremiumGiftStars, raw.types.InputInvoiceSlug, raw.types.InputInvoiceStarGift, raw.types.InputInvoiceStarGiftAuctionBid, raw.types.InputInvoiceStarGiftDropOriginalDetails, raw.types.InputInvoiceStarGiftPrepaidUpgrade, raw.types.InputInvoiceStarGiftResale, raw.types.InputInvoiceStarGiftTransfer, raw.types.InputInvoiceStarGiftUpgrade, raw.types.InputInvoiceStars]
6061

6162
def __init__(self):
6263
raise TypeError("Base types can only be used for type checking purposes: "

pyrogram/raw/base/input_privacy_key.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929

3030

3131
if TYPE_CHECKING:
32-
InputPrivacyKey = Union[raw.types.InputPrivacyKeyAbout, raw.types.InputPrivacyKeyAddedByPhone, raw.types.InputPrivacyKeyBirthday, raw.types.InputPrivacyKeyChatInvite, raw.types.InputPrivacyKeyForwards, raw.types.InputPrivacyKeyNoPaidMessages, raw.types.InputPrivacyKeyPhoneCall, raw.types.InputPrivacyKeyPhoneNumber, raw.types.InputPrivacyKeyPhoneP2P, raw.types.InputPrivacyKeyProfilePhoto, raw.types.InputPrivacyKeyStarGiftsAutoSave, raw.types.InputPrivacyKeyStatusTimestamp, raw.types.InputPrivacyKeyVoiceMessages]
32+
InputPrivacyKey = Union[raw.types.InputPrivacyKeyAbout, raw.types.InputPrivacyKeyAddedByPhone, raw.types.InputPrivacyKeyBirthday, raw.types.InputPrivacyKeyChatInvite, raw.types.InputPrivacyKeyForwards, raw.types.InputPrivacyKeyNoPaidMessages, raw.types.InputPrivacyKeyPhoneCall, raw.types.InputPrivacyKeyPhoneNumber, raw.types.InputPrivacyKeyPhoneP2P, raw.types.InputPrivacyKeyProfilePhoto, raw.types.InputPrivacyKeySavedMusic, raw.types.InputPrivacyKeyStarGiftsAutoSave, raw.types.InputPrivacyKeyStatusTimestamp, raw.types.InputPrivacyKeyVoiceMessages]
3333
else:
3434
# noinspection PyRedeclaration
3535
class InputPrivacyKey(metaclass=BaseTypeMeta): # type: ignore
36-
"""This base type has 13 constructors available.
36+
"""This base type has 14 constructors available.
3737
3838
Constructors:
3939
.. hlist::
@@ -49,13 +49,14 @@ class InputPrivacyKey(metaclass=BaseTypeMeta): # type: ignore
4949
- :obj:`InputPrivacyKeyPhoneNumber <pyrogram.raw.types.InputPrivacyKeyPhoneNumber>`
5050
- :obj:`InputPrivacyKeyPhoneP2P <pyrogram.raw.types.InputPrivacyKeyPhoneP2P>`
5151
- :obj:`InputPrivacyKeyProfilePhoto <pyrogram.raw.types.InputPrivacyKeyProfilePhoto>`
52+
- :obj:`InputPrivacyKeySavedMusic <pyrogram.raw.types.InputPrivacyKeySavedMusic>`
5253
- :obj:`InputPrivacyKeyStarGiftsAutoSave <pyrogram.raw.types.InputPrivacyKeyStarGiftsAutoSave>`
5354
- :obj:`InputPrivacyKeyStatusTimestamp <pyrogram.raw.types.InputPrivacyKeyStatusTimestamp>`
5455
- :obj:`InputPrivacyKeyVoiceMessages <pyrogram.raw.types.InputPrivacyKeyVoiceMessages>`
5556
"""
5657

5758
QUALNAME = "pyrogram.raw.base.InputPrivacyKey"
58-
__union_types__ = Union[raw.types.InputPrivacyKeyAbout, raw.types.InputPrivacyKeyAddedByPhone, raw.types.InputPrivacyKeyBirthday, raw.types.InputPrivacyKeyChatInvite, raw.types.InputPrivacyKeyForwards, raw.types.InputPrivacyKeyNoPaidMessages, raw.types.InputPrivacyKeyPhoneCall, raw.types.InputPrivacyKeyPhoneNumber, raw.types.InputPrivacyKeyPhoneP2P, raw.types.InputPrivacyKeyProfilePhoto, raw.types.InputPrivacyKeyStarGiftsAutoSave, raw.types.InputPrivacyKeyStatusTimestamp, raw.types.InputPrivacyKeyVoiceMessages]
59+
__union_types__ = Union[raw.types.InputPrivacyKeyAbout, raw.types.InputPrivacyKeyAddedByPhone, raw.types.InputPrivacyKeyBirthday, raw.types.InputPrivacyKeyChatInvite, raw.types.InputPrivacyKeyForwards, raw.types.InputPrivacyKeyNoPaidMessages, raw.types.InputPrivacyKeyPhoneCall, raw.types.InputPrivacyKeyPhoneNumber, raw.types.InputPrivacyKeyPhoneP2P, raw.types.InputPrivacyKeyProfilePhoto, raw.types.InputPrivacyKeySavedMusic, raw.types.InputPrivacyKeyStarGiftsAutoSave, raw.types.InputPrivacyKeyStatusTimestamp, raw.types.InputPrivacyKeyVoiceMessages]
5960

6061
def __init__(self):
6162
raise TypeError("Base types can only be used for type checking purposes: "
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Pyrogram - Telegram MTProto API Client Library for Python
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
3+
#
4+
# This file is part of Pyrogram.
5+
#
6+
# Pyrogram is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU Lesser General Public License as published
8+
# by the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# Pyrogram is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU Lesser General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU Lesser General Public License
17+
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
18+
19+
# # # # # # # # # # # # # # # # # # # # # # # #
20+
# !!! WARNING !!! #
21+
# This is a generated file! #
22+
# All changes made in this file will be lost! #
23+
# # # # # # # # # # # # # # # # # # # # # # # #
24+
25+
from typing import TYPE_CHECKING, Union
26+
27+
from pyrogram import raw
28+
from pyrogram.raw.core import BaseTypeMeta
29+
30+
31+
if TYPE_CHECKING:
32+
InputStarGiftAuction = Union[raw.types.InputStarGiftAuction, raw.types.InputStarGiftAuctionSlug]
33+
else:
34+
# noinspection PyRedeclaration
35+
class InputStarGiftAuction(metaclass=BaseTypeMeta): # type: ignore
36+
"""This base type has 2 constructors available.
37+
38+
Constructors:
39+
.. hlist::
40+
:columns: 2
41+
42+
- :obj:`InputStarGiftAuction <pyrogram.raw.types.InputStarGiftAuction>`
43+
- :obj:`InputStarGiftAuctionSlug <pyrogram.raw.types.InputStarGiftAuctionSlug>`
44+
"""
45+
46+
QUALNAME = "pyrogram.raw.base.InputStarGiftAuction"
47+
__union_types__ = Union[raw.types.InputStarGiftAuction, raw.types.InputStarGiftAuctionSlug]
48+
49+
def __init__(self):
50+
raise TypeError("Base types can only be used for type checking purposes: "
51+
"you tried to use a base type instance as argument, "
52+
"but you need to instantiate one of its constructors instead. "
53+
"More info: https://docs.kurigram.live/telegram/base/input-star-gift-auction")

0 commit comments

Comments
 (0)