parent
177823f46e
commit
d022616c99
@ -23,9 +23,11 @@ from json import load as load_json
|
||||
from shutil import copyfile
|
||||
from redis import StrictRedis
|
||||
from logging import getLogger, INFO, DEBUG, ERROR, StreamHandler, basicConfig
|
||||
from distutils2.util import strtobool
|
||||
from distutils.util import strtobool
|
||||
from coloredlogs import ColoredFormatter
|
||||
from telethon import TelegramClient
|
||||
|
||||
# Errors
|
||||
from telethon.errors.rpcerrorlist import MessageNotModifiedError, MessageIdInvalidError, ChannelPrivateError, \
|
||||
ChatSendMediaForbiddenError, YouBlockedUserError, FloodWaitError, ChatWriteForbiddenError, \
|
||||
AuthKeyDuplicatedError
|
||||
|
@ -7,8 +7,8 @@
|
||||
# \//_____/ \/ \/ \/ \/
|
||||
# ===================================================================
|
||||
|
||||
# API Credentials of your telegram application created at https://my.telegram.org/apps
|
||||
api_key: "KEY_HERE"
|
||||
# API Credentials of your telegram application created at https://my.telegram.org/apps | api_key is api_id
|
||||
api_key: "ID_HERE"
|
||||
api_hash: "HASH_HERE"
|
||||
|
||||
# Either debug logging is enabled or not
|
||||
@ -31,12 +31,17 @@ redis:
|
||||
# Locale settings
|
||||
application_language: "zh-cn"
|
||||
application_region: "China"
|
||||
application_tts: "cn"
|
||||
application_tts: "zh-CN"
|
||||
|
||||
# In-Chat logging settings, default settings logs directly into Kat, strongly advised to change
|
||||
log: "False"
|
||||
log_chatid: "503691334"
|
||||
|
||||
# Disabled Built-in Commands
|
||||
disabled_cmd:
|
||||
- example1
|
||||
- example2
|
||||
|
||||
# Google search preferences
|
||||
result_length: "5"
|
||||
|
||||
@ -44,4 +49,33 @@ result_length: "5"
|
||||
width: "1920"
|
||||
height: "1080"
|
||||
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: ""
|
||||
|
@ -1,7 +1,7 @@
|
||||
""" PagerMaid web interface utility. """
|
||||
|
||||
from threading import Thread
|
||||
from distutils2.util import strtobool
|
||||
from distutils.util import strtobool
|
||||
from importlib import import_module
|
||||
from cheroot.wsgi import Server as WSGIServer, PathInfoDispatcher
|
||||
from flask import Flask
|
||||
|
@ -4,7 +4,7 @@ import sys, sentry_sdk, re
|
||||
|
||||
from telethon import events
|
||||
from telethon.errors import MessageTooLongError
|
||||
from distutils2.util import strtobool
|
||||
from distutils.util import strtobool
|
||||
from traceback import format_exc
|
||||
from time import gmtime, strftime, time
|
||||
from telethon.events import StopPropagation
|
||||
|
@ -7,7 +7,7 @@ from telethon.tl.functions.messages import DeleteChatUserRequest
|
||||
from telethon.tl.functions.channels import LeaveChannelRequest
|
||||
from telethon.errors import ForbiddenError
|
||||
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.listener import listener
|
||||
from pagermaid.utils import lang, alias_command
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
import platform, json, time
|
||||
import urllib.request
|
||||
from distutils2.util import strtobool
|
||||
from distutils.util import strtobool
|
||||
from json import JSONDecodeError
|
||||
from subprocess import run, PIPE
|
||||
from datetime import datetime
|
||||
|
@ -18,7 +18,7 @@ def lang(text: str) -> str:
|
||||
return result
|
||||
|
||||
|
||||
def alias_command(command):
|
||||
def alias_command(command: str) -> str:
|
||||
""" alias """
|
||||
try:
|
||||
command = alias_dict[command]
|
||||
@ -108,7 +108,7 @@ async def attach_report(plaintext, file_name, reply_id=None, caption=None):
|
||||
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. """
|
||||
reply = await context.get_reply_message()
|
||||
message = context.arguments
|
||||
@ -149,7 +149,7 @@ async def fetch_youtube_audio(url, chat_id, reply_id, string_2):
|
||||
return True
|
||||
|
||||
|
||||
def owoify(text):
|
||||
def owoify(text: str) -> str:
|
||||
""" Converts your text to OwO """
|
||||
smileys = [';;w;;', '^w^', '>w<', 'UwU', '(・`ω´・)', '(´・ω・`)']
|
||||
with open(f"{module_dir}/assets/replacements.json") as fp:
|
||||
@ -179,6 +179,6 @@ def owoify(text):
|
||||
return text
|
||||
|
||||
|
||||
def clear_emojis(target):
|
||||
def clear_emojis(target: str) -> str:
|
||||
""" Removes all Emojis from provided string """
|
||||
return get_emoji_regexp().sub(u'', target)
|
||||
|
@ -21,7 +21,6 @@ Telethon>=1.23.0
|
||||
Pillow>=8.2.0
|
||||
python-magic>=0.4.24
|
||||
Pygments>=2.9.0
|
||||
distutils2-py3>=1.0a5.dev0
|
||||
speedtest-cli>=2.1.3
|
||||
GitPython>=3.1.17
|
||||
Werkzeug>=2.0.1
|
||||
|
Loading…
Reference in New Issue
Block a user