🔖 Update to v1.2.6

This commit is contained in:
xtaodada 2022-08-14 12:44:43 +08:00
parent b8a8d1e4af
commit 5d14872bd5
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
4 changed files with 11 additions and 16 deletions

View File

@ -1,4 +1,5 @@
import contextlib import contextlib
import sys
from typing import Callable, Awaitable, Set, Dict from typing import Callable, Awaitable, Set, Dict
@ -7,15 +8,12 @@ from datetime import datetime, timezone
from logging import getLogger, StreamHandler, CRITICAL, INFO, basicConfig, DEBUG, Formatter, FileHandler from logging import getLogger, StreamHandler, CRITICAL, INFO, basicConfig, DEBUG, Formatter, FileHandler
from os import getcwd from os import getcwd
from pyrogram.errors import PeerIdInvalid
from pagermaid.config import Config from pagermaid.config import Config
from pagermaid.scheduler import scheduler from pagermaid.scheduler import scheduler
import pyromod.listen import pyromod.listen
from pyrogram import Client from pyrogram import Client
import sys
pgm_version = "1.2.5" pgm_version = "1.2.6"
CMD_LIST = {} CMD_LIST = {}
module_dir = __path__[0] module_dir = __path__[0]
working_dir = getcwd() working_dir = getcwd()
@ -78,5 +76,6 @@ async def log(message):
Config.LOG_ID, Config.LOG_ID,
message message
) )
except PeerIdInvalid: except Exception:
Config.LOG = False Config.LOG = False
Config.LOG_ID = "me"

View File

@ -95,4 +95,4 @@ async def recovery(message: Message):
os.remove(pgm_backup_zip_name) os.remove(pgm_backup_zip_name)
await message.edit(lang('recovery_success') + " " + lang('apt_reboot')) await message.edit(lang('recovery_success') + " " + lang('apt_reboot'))
sys.exit(1) sys.exit(0)

View File

@ -163,17 +163,13 @@ def sudo_filter(permission: str):
def from_self(message: Message) -> bool: def from_self(message: Message) -> bool:
if message.outgoing: if message.outgoing:
return True return True
if message.from_user: return message.from_user.is_self if message.from_user else False
return message.from_user.is_self
return False
def from_msg_get_sudo_uid(message: Message) -> int: def from_msg_get_sudo_uid(message: Message) -> int:
""" Get the sudo uid from the message. """ """ Get the sudo uid from the message. """
from_id = message.from_user.id if message.from_user else message.sender_chat.id from_id = message.from_user.id if message.from_user else message.sender_chat.id
if from_id in get_sudo_list(): return from_id if from_id in get_sudo_list() else message.chat.id
return from_id
return message.chat.id
def check_manage_subs(message: Message) -> bool: def check_manage_subs(message: Message) -> bool:

View File

@ -1,4 +1,4 @@
pyrogram==2.0.35 pyrogram==2.0.38
TgCrypto>=1.2.3 TgCrypto>=1.2.3
Pillow>=8.4.0 Pillow>=8.4.0
pytz>=2021.3 pytz>=2021.3
@ -8,7 +8,7 @@ psutil>=5.8.0
httpx httpx
apscheduler apscheduler
sqlitedict sqlitedict
casbin==1.16.11 casbin==1.17.0
mixpanel mixpanel==4.10.0
mixpanel-py-async mixpanel-py-async
sentry-sdk==1.9.0 sentry-sdk==1.9.4