mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-09 16:14:52 +00:00
Fix PyCharm mess when merged develop into asyncio
This commit is contained in:
parent
9999c77e95
commit
63cb4b412e
8 changed files with 152 additions and 152 deletions
|
|
@ -177,25 +177,25 @@ class SendAnimation(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(animation, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(animation, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -176,25 +176,25 @@ class SendAudio(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(audio, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(audio, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -157,25 +157,25 @@ class SendDocument(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(document, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(document, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -153,25 +153,25 @@ class SendPhoto(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(photo, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(photo, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -137,25 +137,25 @@ class SendSticker(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
message=""
|
message=""
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(sticker, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(sticker, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -180,25 +180,25 @@ class SendVideo(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(video, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(video, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -155,25 +155,25 @@ class SendVideoNote(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
message=""
|
message=""
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(video_note, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(video_note, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
|
|
@ -156,25 +156,25 @@ class SendVoice(BaseClient):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
r = await self.send(
|
r = await self.send(
|
||||||
functions.messages.SendMedia(
|
functions.messages.SendMedia(
|
||||||
peer=await self.resolve_peer(chat_id),
|
peer=await self.resolve_peer(chat_id),
|
||||||
media=media,
|
media=media,
|
||||||
silent=disable_notification or None,
|
silent=disable_notification or None,
|
||||||
reply_to_msg_id=reply_to_message_id,
|
reply_to_msg_id=reply_to_message_id,
|
||||||
random_id=self.rnd_id(),
|
random_id=self.rnd_id(),
|
||||||
reply_markup=reply_markup.write() if reply_markup else None,
|
reply_markup=reply_markup.write() if reply_markup else None,
|
||||||
**style.parse(caption)
|
**style.parse(caption)
|
||||||
)
|
|
||||||
)
|
|
||||||
except FilePartMissing as e:
|
|
||||||
await self.save_file(voice, file_id=file.id, file_part=e.x)
|
|
||||||
else:
|
|
||||||
for i in r.updates:
|
|
||||||
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
|
||||||
return await pyrogram.Message._parse(
|
|
||||||
self, i.message,
|
|
||||||
{i.id: i for i in r.users},
|
|
||||||
{i.id: i for i in r.chats}
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
except FilePartMissing as e:
|
||||||
|
await self.save_file(voice, file_id=file.id, file_part=e.x)
|
||||||
|
else:
|
||||||
|
for i in r.updates:
|
||||||
|
if isinstance(i, (types.UpdateNewMessage, types.UpdateNewChannelMessage)):
|
||||||
|
return await pyrogram.Message._parse(
|
||||||
|
self, i.message,
|
||||||
|
{i.id: i for i in r.users},
|
||||||
|
{i.id: i for i in r.chats}
|
||||||
|
)
|
||||||
except BaseClient.StopTransmission:
|
except BaseClient.StopTransmission:
|
||||||
return None
|
return None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue