Remove unnecessary requirement (#117)

 移除不必要的依赖项
This commit is contained in:
Xtao_dada 2021-08-18 16:41:22 +08:00 committed by GitHub
parent 177823f46e
commit d022616c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 14 deletions

View File

@ -23,9 +23,11 @@ from json import load as load_json
from shutil import copyfile from shutil import copyfile
from redis import StrictRedis from redis import StrictRedis
from logging import getLogger, INFO, DEBUG, ERROR, StreamHandler, basicConfig from logging import getLogger, INFO, DEBUG, ERROR, StreamHandler, basicConfig
from distutils2.util import strtobool from distutils.util import strtobool
from coloredlogs import ColoredFormatter from coloredlogs import ColoredFormatter
from telethon import TelegramClient from telethon import TelegramClient
# Errors
from telethon.errors.rpcerrorlist import MessageNotModifiedError, MessageIdInvalidError, ChannelPrivateError, \ from telethon.errors.rpcerrorlist import MessageNotModifiedError, MessageIdInvalidError, ChannelPrivateError, \
ChatSendMediaForbiddenError, YouBlockedUserError, FloodWaitError, ChatWriteForbiddenError, \ ChatSendMediaForbiddenError, YouBlockedUserError, FloodWaitError, ChatWriteForbiddenError, \
AuthKeyDuplicatedError AuthKeyDuplicatedError

View File

@ -7,8 +7,8 @@
# \//_____/ \/ \/ \/ \/ # \//_____/ \/ \/ \/ \/
# =================================================================== # ===================================================================
# API Credentials of your telegram application created at https://my.telegram.org/apps # API Credentials of your telegram application created at https://my.telegram.org/apps | api_key is api_id
api_key: "KEY_HERE" api_key: "ID_HERE"
api_hash: "HASH_HERE" api_hash: "HASH_HERE"
# Either debug logging is enabled or not # Either debug logging is enabled or not
@ -31,12 +31,17 @@ redis:
# Locale settings # Locale settings
application_language: "zh-cn" application_language: "zh-cn"
application_region: "China" application_region: "China"
application_tts: "cn" application_tts: "zh-CN"
# In-Chat logging settings, default settings logs directly into Kat, strongly advised to change # In-Chat logging settings, default settings logs directly into Kat, strongly advised to change
log: "False" log: "False"
log_chatid: "503691334" log_chatid: "503691334"
# Disabled Built-in Commands
disabled_cmd:
- example1
- example2
# Google search preferences # Google search preferences
result_length: "5" result_length: "5"
@ -45,3 +50,32 @@ width: "1920"
height: "1080" height: "1080"
background: "#101010" background: "#101010"
margin: "20" margin: "20"
# socks5 or http or MTProto
proxy_addr: ""
proxy_port: ""
http_addr: ""
http_port: ""
mtp_addr: ""
mtp_port: ""
mtp_secret: ""
# Apt Git source
git_source: "https://raw.githubusercontent.com/Xtao-Labs/PagerMaid_Plugins/master/"
git_api: "https://api.github.com/repos/Xtao-Labs/PagerMaid-Modify/commits/master"
git_ssh: "https://github.com/Xtao-Labs/PagerMaid-Modify.git"
# Update Notice
update_check: "True"
update_time: "86400"
update_username: "self"
update_delete: "True"
# ipv6
ipv6: "False"
# Analytics
allow_analytic: "True"
# speed_test
speed_test_path: ""

View File

@ -1,7 +1,7 @@
""" PagerMaid web interface utility. """ """ PagerMaid web interface utility. """
from threading import Thread from threading import Thread
from distutils2.util import strtobool from distutils.util import strtobool
from importlib import import_module from importlib import import_module
from cheroot.wsgi import Server as WSGIServer, PathInfoDispatcher from cheroot.wsgi import Server as WSGIServer, PathInfoDispatcher
from flask import Flask from flask import Flask

View File

@ -4,7 +4,7 @@ import sys, sentry_sdk, re
from telethon import events from telethon import events
from telethon.errors import MessageTooLongError from telethon.errors import MessageTooLongError
from distutils2.util import strtobool from distutils.util import strtobool
from traceback import format_exc from traceback import format_exc
from time import gmtime, strftime, time from time import gmtime, strftime, time
from telethon.events import StopPropagation from telethon.events import StopPropagation

View File

@ -7,7 +7,7 @@ from telethon.tl.functions.messages import DeleteChatUserRequest
from telethon.tl.functions.channels import LeaveChannelRequest from telethon.tl.functions.channels import LeaveChannelRequest
from telethon.errors import ForbiddenError from telethon.errors import ForbiddenError
from telethon.errors.rpcerrorlist import ChatIdInvalidError, FloodWaitError from telethon.errors.rpcerrorlist import ChatIdInvalidError, FloodWaitError
from distutils2.util import strtobool from distutils.util import strtobool
from pagermaid import bot, log, config from pagermaid import bot, log, config
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import lang, alias_command from pagermaid.utils import lang, alias_command

View File

@ -2,7 +2,7 @@
import platform, json, time import platform, json, time
import urllib.request import urllib.request
from distutils2.util import strtobool from distutils.util import strtobool
from json import JSONDecodeError from json import JSONDecodeError
from subprocess import run, PIPE from subprocess import run, PIPE
from datetime import datetime from datetime import datetime

View File

@ -18,7 +18,7 @@ def lang(text: str) -> str:
return result return result
def alias_command(command): def alias_command(command: str) -> str:
""" alias """ """ alias """
try: try:
command = alias_dict[command] command = alias_dict[command]
@ -108,7 +108,7 @@ async def attach_report(plaintext, file_name, reply_id=None, caption=None):
remove(file_name) remove(file_name)
async def obtain_message(context): async def obtain_message(context) -> str:
""" Obtains a message from either the reply message or command arguments. """ """ Obtains a message from either the reply message or command arguments. """
reply = await context.get_reply_message() reply = await context.get_reply_message()
message = context.arguments message = context.arguments
@ -149,7 +149,7 @@ async def fetch_youtube_audio(url, chat_id, reply_id, string_2):
return True return True
def owoify(text): def owoify(text: str) -> str:
""" Converts your text to OwO """ """ Converts your text to OwO """
smileys = [';;w;;', '^w^', '>w<', 'UwU', '(・`ω´・)', '(´・ω・`)'] smileys = [';;w;;', '^w^', '>w<', 'UwU', '(・`ω´・)', '(´・ω・`)']
with open(f"{module_dir}/assets/replacements.json") as fp: with open(f"{module_dir}/assets/replacements.json") as fp:
@ -179,6 +179,6 @@ def owoify(text):
return text return text
def clear_emojis(target): def clear_emojis(target: str) -> str:
""" Removes all Emojis from provided string """ """ Removes all Emojis from provided string """
return get_emoji_regexp().sub(u'', target) return get_emoji_regexp().sub(u'', target)

View File

@ -21,7 +21,6 @@ Telethon>=1.23.0
Pillow>=8.2.0 Pillow>=8.2.0
python-magic>=0.4.24 python-magic>=0.4.24
Pygments>=2.9.0 Pygments>=2.9.0
distutils2-py3>=1.0a5.dev0
speedtest-cli>=2.1.3 speedtest-cli>=2.1.3
GitPython>=3.1.17 GitPython>=3.1.17
Werkzeug>=2.0.1 Werkzeug>=2.0.1