From 5ab4f0a54cad0e00a40553e425283e8d9ff514f9 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 1 Sep 2022 11:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Update=20to=20v1.2.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 12 ++++++++++++ pagermaid/__init__.py | 2 +- pagermaid/modules/message.py | 19 +++++++++++-------- pagermaid/utils.py | 2 +- requirements.txt | 6 +++--- 5 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1bbfc88 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: +- package-ecosystem: pip + directory: "/" + schedule: + interval: daily + time: "18:00" + timezone: Asia/Shanghai + open-pull-requests-limit: 10 + allow: + - dependency-type: direct + - dependency-type: indirect diff --git a/pagermaid/__init__.py b/pagermaid/__init__.py index c7c11c8..4b2a051 100644 --- a/pagermaid/__init__.py +++ b/pagermaid/__init__.py @@ -13,7 +13,7 @@ from pagermaid.scheduler import scheduler import pyromod.listen from pyrogram import Client -pgm_version = "1.2.7" +pgm_version = "1.2.8" CMD_LIST = {} module_dir = __path__[0] working_dir = getcwd() diff --git a/pagermaid/modules/message.py b/pagermaid/modules/message.py index f1455a0..134cd96 100644 --- a/pagermaid/modules/message.py +++ b/pagermaid/modules/message.py @@ -60,15 +60,16 @@ async def userid(message: Message): pass if reply.forward_from_chat: text += "\n\n**Forward From Channel**\n" \ - "id: `" + str(message.forward_from_chat.id) + \ - "`\ntitle: `" + message.forward_from_chat.title + "`" - if message.forward_from_chat.username: - text += "\nusername: @" + message.forward_from_chat.username - text += "\nmessage_id: `" + str(message.forward_from_message_id) + "`" - if message.forward_sender_name: - text += "\npost_author: `" + message.forward_sender_name + "`" + "id: `" + str(reply.forward_from_chat.id) + \ + "`\ntitle: `" + reply.forward_from_chat.title + "`" + if reply.forward_from_chat.username: + text += "\nusername: @" + reply.forward_from_chat.username + if reply.forward_from_message_id: + text += "\nmessage_id: `" + str(reply.forward_from_message_id) + "`" + if reply.forward_sender_name: + text += "\npost_author: `" + reply.forward_sender_name + "`" elif reply.forward_from: - text += "\n\n**Forward From User**\nid: `" + str(message.forward_from.id) + "`" + text += "\n\n**Forward From User**\nid: `" + str(reply.forward_from.id) + "`" try: if reply.forward_from.is_bot: text += f"\nis_bot: {lang('id_is_bot_yes')}" @@ -84,6 +85,8 @@ async def userid(message: Message): text += "\ndc: `" + str(reply.forward_from.dc_id) + "`" except AttributeError: pass + elif reply.forward_sender_name: + text += "\n\n**Forward From User**\nsender_name: `" + str(reply.forward_sender_name) + "`" await message.edit(text) diff --git a/pagermaid/utils.py b/pagermaid/utils.py index 65f78f0..d9d545c 100644 --- a/pagermaid/utils.py +++ b/pagermaid/utils.py @@ -45,7 +45,7 @@ async def attach_report(plaintext, file_name, reply_id=None, caption=None): async def attach_log(plaintext, chat_id, file_name, reply_id=None, caption=None): """ Attach plaintext as logs. """ - with open(file_name, "w+") as file: + with open(file_name, "w+", encoding='utf-8') as file: file.write(plaintext) await bot.send_document( chat_id, diff --git a/requirements.txt b/requirements.txt index 81b85fd..e80b783 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pyrogram==2.0.41 +pyrogram==2.0.43 TgCrypto>=1.2.3 Pillow>=8.4.0 pytz>=2021.3 @@ -8,7 +8,7 @@ psutil>=5.8.0 httpx apscheduler sqlitedict -casbin==1.17.0 +casbin==1.17.1 mixpanel==4.10.0 mixpanel-py-async -sentry-sdk==1.9.4 +sentry-sdk==1.9.6