mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 11:02:58 +00:00
🔖 Update to v1.0.3
This commit is contained in:
parent
fade059e80
commit
c1c8446252
@ -55,8 +55,8 @@ mtp_port: ""
|
||||
mtp_secret: ""
|
||||
|
||||
# Apt Git source
|
||||
git_source: "https://gitlab.com/Xtao-Labs/PagerMaid_Plugins/-/raw/v2/"
|
||||
git_ssh: "https://gitlab.com/Xtao-Labs/PagerMaid-Pyro.git"
|
||||
git_source: "https://raw.githubusercontent.com/TeamPGM/PagerMaid_Plugins/v2/"
|
||||
git_ssh: "https://github.com/TeamPGM/PagerMaid-Pyro.git"
|
||||
|
||||
# Update Notice
|
||||
update_check: "True"
|
||||
|
@ -1,5 +1,5 @@
|
||||
from coloredlogs import ColoredFormatter
|
||||
from logging import getLogger, StreamHandler, CRITICAL, INFO, basicConfig
|
||||
from logging import getLogger, StreamHandler, CRITICAL, INFO, basicConfig, DEBUG
|
||||
from datetime import datetime
|
||||
from os import getcwd
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
@ -9,7 +9,7 @@ import pyromod.listen
|
||||
from pyrogram import Client
|
||||
import sys
|
||||
|
||||
pgm_version = "1.0.2"
|
||||
pgm_version = "1.0.3"
|
||||
CMD_LIST = {}
|
||||
module_dir = __path__[0]
|
||||
working_dir = getcwd()
|
||||
@ -25,10 +25,10 @@ logging_format = "%(levelname)s [%(asctime)s] [%(name)s] %(message)s"
|
||||
logging_handler = StreamHandler()
|
||||
logging_handler.setFormatter(ColoredFormatter(logging_format))
|
||||
root_logger = getLogger()
|
||||
root_logger.setLevel(CRITICAL)
|
||||
root_logger.setLevel(DEBUG if Config.DEBUG else CRITICAL)
|
||||
root_logger.addHandler(logging_handler)
|
||||
basicConfig(level=INFO)
|
||||
logs.setLevel(INFO)
|
||||
basicConfig(level=DEBUG if Config.DEBUG else INFO)
|
||||
logs.setLevel(DEBUG if Config.DEBUG else INFO)
|
||||
|
||||
# easy check
|
||||
if not Config.API_ID:
|
||||
@ -39,6 +39,12 @@ elif not Config.API_HASH:
|
||||
sys.exit(1)
|
||||
|
||||
start_time = datetime.utcnow()
|
||||
|
||||
try:
|
||||
import uvloop
|
||||
uvloop.install()
|
||||
except ImportError:
|
||||
pass
|
||||
bot = Client("pagermaid",
|
||||
session_string=Config.STRING_SESSION,
|
||||
api_id=Config.API_ID,
|
||||
|
@ -8,23 +8,28 @@ from pagermaid import bot, logs, working_dir
|
||||
from pagermaid.modules import module_list, plugin_list
|
||||
from pagermaid.utils import lang
|
||||
|
||||
|
||||
path.insert(1, f"{working_dir}{sep}plugins")
|
||||
logs.info(lang('platform') + platform + lang('platform_load'))
|
||||
bot.start()
|
||||
|
||||
for module_name in module_list:
|
||||
|
||||
async def main():
|
||||
logs.info(lang('platform') + platform + lang('platform_load'))
|
||||
|
||||
await bot.start()
|
||||
|
||||
for module_name in module_list:
|
||||
try:
|
||||
import_module("pagermaid.modules." + module_name)
|
||||
except BaseException as exception:
|
||||
logs.info(f"{lang('module')} {module_name} {lang('error')}: {type(exception)}: {exception}")
|
||||
for plugin_name in plugin_list:
|
||||
for plugin_name in plugin_list:
|
||||
try:
|
||||
import_module("plugins." + plugin_name)
|
||||
except BaseException as exception:
|
||||
logs.info(f"{lang('module')} {plugin_name} {lang('error')}: {exception}")
|
||||
plugin_list.remove(plugin_name)
|
||||
|
||||
logs.info(lang('start'))
|
||||
idle()
|
||||
bot.stop()
|
||||
logs.info(lang('start'))
|
||||
await idle()
|
||||
await bot.stop()
|
||||
|
||||
bot.run(main())
|
||||
|
@ -15,7 +15,7 @@ async def update(_: Client, message: Message):
|
||||
if len(message.parameter) > 0:
|
||||
await execute('git reset --hard origin/master')
|
||||
await execute('git pull --all')
|
||||
await execute(f"{executable} -m pip install -r requirements.txt --upgrade")
|
||||
await execute(f"{executable} -m pip install --upgrade -r requirements.txt")
|
||||
await execute(f"{executable} -m pip install -r requirements.txt")
|
||||
await message.edit(lang('update_success'))
|
||||
exit(1)
|
||||
|
@ -1,4 +1,4 @@
|
||||
pyrogram==2.0.24
|
||||
pyrogram==2.0.26
|
||||
TgCrypto>=1.2.3
|
||||
Pillow>=8.4.0
|
||||
pytz>=2021.3
|
||||
|
@ -85,7 +85,7 @@ data_persistence () {
|
||||
docker cp $container_name:/pagermaid/workdir $data_path
|
||||
docker stop $container_name &>/dev/null
|
||||
docker rm $container_name &>/dev/null
|
||||
docker run -dit -e PUID=$PUID -e PGID=$PGID -v $data_path/workdir:/pagermaid/workdir --restart=always --name="$container_name" --hostname="$container_name" mrwangzhe/pagermaid_modify <&1
|
||||
docker run -dit -e PUID=$PUID -e PGID=$PGID -v $data_path/workdir:/pagermaid/workdir --restart=always --name="$container_name" --hostname="$container_name" teampgm/pagermaid_pyro <&1
|
||||
echo
|
||||
echo "数据持久化操作完成。"
|
||||
echo
|
||||
|
@ -451,7 +451,7 @@ start_installation() {
|
||||
configure
|
||||
login_screen
|
||||
systemctl_reload
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 -help 并发送查看帮助列表"
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 ,help 并发送查看帮助列表"
|
||||
elif [ "$release" = "ubuntu" ]; then
|
||||
echo "系统检测通过。"
|
||||
welcome
|
||||
@ -465,7 +465,7 @@ start_installation() {
|
||||
configure
|
||||
login_screen
|
||||
systemctl_reload
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 -help 并发送查看帮助列表"
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 ,help 并发送查看帮助列表"
|
||||
elif [ "$release" = "debian" ]; then
|
||||
echo "系统检测通过。"
|
||||
welcome
|
||||
@ -479,7 +479,7 @@ start_installation() {
|
||||
configure
|
||||
login_screen
|
||||
systemctl_reload
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 -help 并发送查看帮助列表"
|
||||
echo "PagerMaid 已经安装完毕 在telegram对话框中输入 ,help 并发送查看帮助列表"
|
||||
else
|
||||
echo "目前暂时不支持此系统。"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user