Skip to content

Commit 7cd7784

Browse files
committed
Merge remote-tracking branch 'KurimuzonAkuma/dev' into dev
# Conflicts: # pyproject.toml # pyrogram/utils.py
2 parents 305ed95 + 7209378 commit 7cd7784

38 files changed

Lines changed: 415 additions & 59 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
<br>
66
<b>Telegram MTProto API Framework for Python</b>
77
<br>
8-
<a href="https://kurigram.live">
8+
<a href="https://kurigram.icu">
99
Homepage
1010
</a>
1111
12-
<a href="https://docs.kurigram.live">
12+
<a href="https://docs.kurigram.icu">
1313
Documentation
1414
</a>
1515
@@ -40,7 +40,7 @@ async def hello(client, message):
4040
app.run()
4141
```
4242

43-
**Pyrogram** is a modern, elegant and asynchronous [MTProto API](https://docs.kurigram.live/topics/mtproto-vs-botapi)
43+
**Pyrogram** is a modern, elegant and asynchronous [MTProto API](https://docs.kurigram.icu/topics/mtproto-vs-botapi)
4444
framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot
4545
identity (bot API alternative) using Python.
4646

@@ -76,7 +76,7 @@ pip3 install https://github.com/KurimuzonAkuma/kurigram/archive/dev.zip --force-
7676

7777
### Resources
7878

79-
- Check out the [docs](https://docs.kurigram.live) to learn more about Pyrogram, get started right
79+
- Check out the [docs](https://docs.kurigram.icu) to learn more about Pyrogram, get started right
8080
away and discover more in-depth material for building your client applications.
8181
- Join the [official channel](https://t.me/kurigram_news) and stay tuned for news, updates and announcements.
8282
- Join the [official chat](https://t.me/kurigram_chat) to communicate with people.

compiler/api/template/type.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ else:
2323
raise TypeError("Base types can only be used for type checking purposes: "
2424
"you tried to use a base type instance as argument, "
2525
"but you need to instantiate one of its constructors instead. "
26-
"More info: https://docs.kurigram.live/telegram/base/{doc_name}")
26+
"More info: https://docs.kurigram.icu/telegram/base/{doc_name}")

pyrogram/enums/privacy_key.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,6 @@ class PrivacyKey(AutoName):
6161

6262
NO_PAID_MESSAGES = raw.types.InputPrivacyKeyNoPaidMessages
6363
"Whether people who won't have to pay to send you messages"
64+
65+
SAVED_MUSIC = raw.types.InputPrivacyKeySavedMusic
66+
"Whether people can see your saved music list"

pyrogram/methods/bots/send_invoice.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ async def send_invoice(
5858
allow_paid_broadcast: Optional[bool] = None,
5959
direct_messages_topic_id: Optional[int] = None,
6060
suggested_post_parameters: Optional["types.SuggestedPostParameters"] = None,
61+
subscription_expiration_date: Optional[int] = None,
6162
reply_markup: Optional[Union[
6263
"types.InlineKeyboardMarkup",
6364
"types.ReplyKeyboardMarkup",
@@ -169,6 +170,11 @@ async def send_invoice(
169170
suggested_post_parameters (:obj:`~pyrogram.types.SuggestedPostParameters`, *optional*):
170171
Information about the suggested post.
171172
173+
subscription_expiration_date (``int``, *optional*):
174+
Expiration date of the subscription, in Unix time.
175+
Currently the only allowed subscription period is 30*24*60*60 (1 month).
176+
For recurring payments only.
177+
172178
reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
173179
Additional interface options. An object for an inline keyboard, custom reply keyboard,
174180
instructions to remove reply keyboard or to force a reply from the user.
@@ -222,7 +228,9 @@ async def send_invoice(
222228
phone_to_provider=send_phone_number_to_provider,
223229
email_to_provider=send_email_to_provider,
224230
max_tip_amount=max_tip_amount,
225-
suggested_tip_amounts=suggested_tip_amounts
231+
suggested_tip_amounts=suggested_tip_amounts,
232+
recurring=True if subscription_expiration_date is not None else None,
233+
subscription_period=subscription_expiration_date
226234
),
227235
payload=payload.encode() if isinstance(payload, str) else payload,
228236
provider=provider_token,

pyrogram/methods/messages/forward_messages.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ async def forward_messages(
3232
message_thread_id: int = None,
3333
disable_notification: bool = None,
3434
schedule_date: datetime = None,
35+
repeat_period: int = None,
3536
hide_sender_name: bool = None,
3637
hide_captions: bool = None,
3738
protect_content: bool = None,
@@ -69,6 +70,9 @@ async def forward_messages(
6970
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
7071
Date when the message will be automatically sent.
7172
73+
repeat_period (``int``, *optional*):
74+
Period after which the message will be sent again in seconds.
75+
7276
hide_sender_name (``bool``, *optional*):
7377
If True, the original author of the message will not be shown.
7478
@@ -117,6 +121,7 @@ async def forward_messages(
117121
silent=disable_notification or None,
118122
random_id=[self.rnd_id() for _ in message_ids],
119123
schedule_date=utils.datetime_to_timestamp(schedule_date),
124+
schedule_repeat_period=repeat_period,
120125
drop_author=hide_sender_name,
121126
drop_media_captions=hide_captions,
122127
noforwards=protect_content,

pyrogram/methods/messages/send_animation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ async def send_animation(
5151
show_caption_above_media: bool = None,
5252
reply_parameters: "types.ReplyParameters" = None,
5353
schedule_date: datetime = None,
54+
repeat_period: int = None,
5455
protect_content: bool = None,
5556
business_connection_id: str = None,
5657
allow_paid_broadcast: bool = None,
@@ -150,6 +151,9 @@ async def send_animation(
150151
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
151152
Date when the message will be automatically sent.
152153
154+
repeat_period (``int``, *optional*):
155+
Period after which the message will be sent again in seconds.
156+
153157
protect_content (``bool``, *optional*):
154158
Protects the contents of the sent message from forwarding and saving.
155159
@@ -334,6 +338,7 @@ async def progress(current, total):
334338
),
335339
random_id=self.rnd_id(),
336340
schedule_date=utils.datetime_to_timestamp(schedule_date),
341+
schedule_repeat_period=repeat_period,
337342
noforwards=protect_content,
338343
allow_paid_floodskip=allow_paid_broadcast,
339344
reply_markup=await reply_markup.write(self) if reply_markup else None,

pyrogram/methods/messages/send_audio.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ async def send_audio(
4848
effect_id: int = None,
4949
reply_parameters: "types.ReplyParameters" = None,
5050
schedule_date: datetime = None,
51+
repeat_period: int = None,
5152
protect_content: bool = None,
5253
business_connection_id: str = None,
5354
allow_paid_broadcast: bool = None,
@@ -139,6 +140,9 @@ async def send_audio(
139140
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
140141
Date when the message will be automatically sent.
141142
143+
repeat_period (``int``, *optional*):
144+
Period after which the message will be sent again in seconds.
145+
142146
protect_content (``bool``, *optional*):
143147
Protects the contents of the sent message from forwarding and saving.
144148
@@ -322,6 +326,7 @@ async def progress(current, total):
322326
),
323327
random_id=self.rnd_id(),
324328
schedule_date=utils.datetime_to_timestamp(schedule_date),
329+
schedule_repeat_period=repeat_period,
325330
noforwards=protect_content,
326331
allow_paid_floodskip=allow_paid_broadcast,
327332
reply_markup=await reply_markup.write(self) if reply_markup else None,

pyrogram/methods/messages/send_checklist.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
import logging
2020
from datetime import datetime
21-
from typing import List, Optional, Union
21+
from typing import Optional, Union
2222

2323
import pyrogram
24-
from pyrogram import enums, raw, types, utils
24+
from pyrogram import raw, types, utils
2525

2626
log = logging.getLogger(__name__)
2727

@@ -36,6 +36,7 @@ async def send_checklist(
3636
effect_id: Optional[int] = None,
3737
reply_parameters: Optional["types.ReplyParameters"] = None,
3838
schedule_date: Optional[datetime] = None,
39+
repeat_period: Optional[int] = None,
3940
business_connection_id: Optional[str] = None,
4041
paid_message_star_count: int = None,
4142
reply_markup: Optional[
@@ -81,6 +82,9 @@ async def send_checklist(
8182
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
8283
Date when the message will be automatically sent.
8384
85+
repeat_period (``int``, *optional*):
86+
Period after which the message will be sent again in seconds.
87+
8488
business_connection_id (``str``, *optional*):
8589
Unique identifier of the business connection on behalf of which the message will be sent.
8690
@@ -133,6 +137,7 @@ async def send_checklist(
133137
),
134138
random_id=self.rnd_id(),
135139
schedule_date=utils.datetime_to_timestamp(schedule_date),
140+
schedule_repeat_period=repeat_period,
136141
noforwards=protect_content,
137142
allow_paid_stars=paid_message_star_count,
138143
reply_markup=await reply_markup.write(self) if reply_markup else None,

pyrogram/methods/messages/send_document.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ async def send_document(
4646
effect_id: int = None,
4747
reply_parameters: "types.ReplyParameters" = None,
4848
schedule_date: datetime = None,
49+
repeat_period: int = None,
4950
protect_content: bool = None,
5051
business_connection_id: str = None,
5152
allow_paid_broadcast: bool = None,
@@ -131,6 +132,9 @@ async def send_document(
131132
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
132133
Date when the message will be automatically sent.
133134
135+
repeat_period (``int``, *optional*):
136+
Period after which the message will be sent again in seconds.
137+
134138
protect_content (``bool``, *optional*):
135139
Protects the contents of the sent message from forwarding and saving.
136140
@@ -294,6 +298,7 @@ async def progress(current, total):
294298
),
295299
random_id=self.rnd_id(),
296300
schedule_date=utils.datetime_to_timestamp(schedule_date),
301+
schedule_repeat_period=repeat_period,
297302
noforwards=protect_content,
298303
allow_paid_floodskip=allow_paid_broadcast,
299304
reply_markup=await reply_markup.write(self) if reply_markup else None,

pyrogram/methods/messages/send_message.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ async def send_message(
4141
show_caption_above_media: bool = None,
4242
reply_parameters: "types.ReplyParameters" = None,
4343
schedule_date: datetime = None,
44+
repeat_period: int = None,
4445
protect_content: bool = None,
4546
business_connection_id: str = None,
4647
allow_paid_broadcast: bool = None,
@@ -106,6 +107,9 @@ async def send_message(
106107
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
107108
Date when the message will be automatically sent.
108109
110+
repeat_period (``int``, *optional*):
111+
Period after which the message will be sent again in seconds.
112+
109113
protect_content (``bool``, *optional*):
110114
Protects the contents of the sent message from forwarding and saving.
111115
@@ -267,6 +271,7 @@ async def send_message(
267271
),
268272
random_id=self.rnd_id(),
269273
schedule_date=utils.datetime_to_timestamp(schedule_date),
274+
schedule_repeat_period=repeat_period,
270275
allow_paid_floodskip=allow_paid_broadcast,
271276
allow_paid_stars=paid_message_star_count,
272277
suggested_post=suggested_post_parameters.write() if suggested_post_parameters else None,

0 commit comments

Comments
 (0)