🔖 Update to v1.2.7

fix #24
This commit is contained in:
xtaodada 2022-08-23 23:11:54 +08:00
parent 27a3a7aed5
commit edf1da1ff9
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 16 additions and 8 deletions

View File

@ -13,7 +13,7 @@ from pagermaid.scheduler import scheduler
import pyromod.listen import pyromod.listen
from pyrogram import Client from pyrogram import Client
pgm_version = "1.2.6" pgm_version = "1.2.7"
CMD_LIST = {} CMD_LIST = {}
module_dir = __path__[0] module_dir = __path__[0]
working_dir = getcwd() working_dir = getcwd()

View File

@ -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/>. along with pyromod. If not, see <https://www.gnu.org/licenses/>.
""" """
import asyncio import asyncio
import contextlib import contextlib
import functools import functools
from typing import Optional, List, Union from typing import Optional, List, Union
import pyrogram import pyrogram
from pyrogram.enums import ChatType
from pagermaid.single_utils import get_sudo_list, Message from pagermaid.single_utils import get_sudo_list, Message
from pagermaid.scheduler import add_delete_message_job from pagermaid.scheduler import add_delete_message_job
@ -247,8 +247,13 @@ class Message(pyrogram.types.Message):
msg = None msg = None
sudo_users = get_sudo_list() sudo_users = get_sudo_list()
reply_to = self.reply_to_message reply_to = self.reply_to_message
from_id = self.from_user.id if self.from_user else self.sender_chat.id from_id = self.chat.id
is_self = self.from_user.is_self if self.from_user else False 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 len(text) < 4096:
if from_id in sudo_users or self.chat.id in sudo_users: 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( msg = await reply_to.reply(
text=text, text=text,
parse_mode=parse_mode, 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: elif is_self:
msg = await self._client.edit_message_text( msg = await self._client.edit_message_text(
@ -272,7 +278,8 @@ class Message(pyrogram.types.Message):
msg = await self.reply( msg = await self.reply(
text=text, text=text,
parse_mode=parse_mode, parse_mode=parse_mode,
disable_web_page_preview=disable_web_page_preview disable_web_page_preview=disable_web_page_preview,
quote=True
) )
else: else:
try: try:
@ -292,7 +299,8 @@ class Message(pyrogram.types.Message):
parse_mode=parse_mode, parse_mode=parse_mode,
entities=entities, entities=entities,
disable_web_page_preview=disable_web_page_preview, disable_web_page_preview=disable_web_page_preview,
reply_markup=reply_markup reply_markup=reply_markup,
quote=True
) )
else: else:
with open("output.log", "w+") as file: with open("output.log", "w+") as file:

View File

@ -1,4 +1,4 @@
pyrogram==2.0.40 pyrogram==2.0.41
TgCrypto>=1.2.3 TgCrypto>=1.2.3
Pillow>=8.4.0 Pillow>=8.4.0
pytz>=2021.3 pytz>=2021.3