mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-21 18:18:17 +00:00
parent
27a3a7aed5
commit
edf1da1ff9
@ -13,7 +13,7 @@ from pagermaid.scheduler import scheduler
|
||||
import pyromod.listen
|
||||
from pyrogram import Client
|
||||
|
||||
pgm_version = "1.2.6"
|
||||
pgm_version = "1.2.7"
|
||||
CMD_LIST = {}
|
||||
module_dir = __path__[0]
|
||||
working_dir = getcwd()
|
||||
|
@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License
|
||||
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
import functools
|
||||
from typing import Optional, List, Union
|
||||
|
||||
import pyrogram
|
||||
from pyrogram.enums import ChatType
|
||||
|
||||
from pagermaid.single_utils import get_sudo_list, Message
|
||||
from pagermaid.scheduler import add_delete_message_job
|
||||
@ -247,8 +247,13 @@ class Message(pyrogram.types.Message):
|
||||
msg = None
|
||||
sudo_users = get_sudo_list()
|
||||
reply_to = self.reply_to_message
|
||||
from_id = self.from_user.id if self.from_user else self.sender_chat.id
|
||||
is_self = self.from_user.is_self if self.from_user else False
|
||||
from_id = self.chat.id
|
||||
is_self = False
|
||||
if self.from_user or self.sender_chat:
|
||||
from_id = self.from_user.id if self.from_user else self.sender_chat.id
|
||||
elif self.chat.type == ChatType.PRIVATE:
|
||||
is_self = True
|
||||
is_self = self.from_user.is_self if self.from_user else is_self
|
||||
|
||||
if len(text) < 4096:
|
||||
if from_id in sudo_users or self.chat.id in sudo_users:
|
||||
@ -256,7 +261,8 @@ class Message(pyrogram.types.Message):
|
||||
msg = await reply_to.reply(
|
||||
text=text,
|
||||
parse_mode=parse_mode,
|
||||
disable_web_page_preview=disable_web_page_preview
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
quote=True
|
||||
)
|
||||
elif is_self:
|
||||
msg = await self._client.edit_message_text(
|
||||
@ -272,7 +278,8 @@ class Message(pyrogram.types.Message):
|
||||
msg = await self.reply(
|
||||
text=text,
|
||||
parse_mode=parse_mode,
|
||||
disable_web_page_preview=disable_web_page_preview
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
quote=True
|
||||
)
|
||||
else:
|
||||
try:
|
||||
@ -292,7 +299,8 @@ class Message(pyrogram.types.Message):
|
||||
parse_mode=parse_mode,
|
||||
entities=entities,
|
||||
disable_web_page_preview=disable_web_page_preview,
|
||||
reply_markup=reply_markup
|
||||
reply_markup=reply_markup,
|
||||
quote=True
|
||||
)
|
||||
else:
|
||||
with open("output.log", "w+") as file:
|
||||
|
@ -1,4 +1,4 @@
|
||||
pyrogram==2.0.40
|
||||
pyrogram==2.0.41
|
||||
TgCrypto>=1.2.3
|
||||
Pillow>=8.4.0
|
||||
pytz>=2021.3
|
||||
|
Loading…
Reference in New Issue
Block a user