mirror of
https://github.com/TeamPGM/PagerMaid-Pyro.git
synced 2024-11-16 11:02:58 +00:00
💄 Format with black 24.x.x
This commit is contained in:
parent
b8c54d0cce
commit
299c8db5dd
@ -147,9 +147,11 @@ def listener(**args) -> CommandHandlerDecorator:
|
||||
def decorator(function) -> CommandHandler:
|
||||
func = CommandHandler(
|
||||
function,
|
||||
alias_command(command, disallow_alias)
|
||||
if command and parent_command is None
|
||||
else None,
|
||||
(
|
||||
alias_command(command, disallow_alias)
|
||||
if command and parent_command is None
|
||||
else None
|
||||
),
|
||||
)
|
||||
|
||||
async def handler(client: Client, message: Message):
|
||||
|
@ -1,4 +1,5 @@
|
||||
""" Pagermaid backup and recovery plugin. """
|
||||
|
||||
import os
|
||||
import sys
|
||||
import tarfile
|
||||
|
@ -1,4 +1,5 @@
|
||||
""" The help module. """
|
||||
|
||||
from os import listdir
|
||||
|
||||
from pyrogram.enums import ParseMode
|
||||
|
@ -1,4 +1,5 @@
|
||||
""" Pagermaid message plugin. """
|
||||
|
||||
from pyrogram.enums import ChatType
|
||||
from pyrogram.errors import Forbidden, FloodWait
|
||||
|
||||
|
@ -106,7 +106,8 @@ async def ping_dc(message: Message):
|
||||
data.append("0")
|
||||
else:
|
||||
result = await execute(
|
||||
f"ping -c 1 {DCs[dc]} | awk -F 'time=' " + "'/time=/ {print $2}' | awk '{print $1}'"
|
||||
f"ping -c 1 {DCs[dc]} | awk -F 'time=' "
|
||||
+ "'/time=/ {print $2}' | awk '{print $1}'"
|
||||
)
|
||||
try:
|
||||
data.append(str(float(result)))
|
||||
|
@ -18,7 +18,9 @@ def authentication():
|
||||
try:
|
||||
jwt.decode(token, Config.WEB_SECRET_KEY, algorithms=ALGORITHM)
|
||||
except (jwt.JWTError, jwt.ExpiredSignatureError, AttributeError):
|
||||
raise HTTPException(status_code=400, detail="登录验证失败或已失效,请重新登录")
|
||||
raise HTTPException(
|
||||
status_code=400, detail="登录验证失败或已失效,请重新登录"
|
||||
)
|
||||
|
||||
return Depends(inner)
|
||||
|
||||
|
@ -74,6 +74,8 @@ page = PageSchema(
|
||||
icon="fa fa-ban",
|
||||
label="忽略群组",
|
||||
schema=Page(
|
||||
title="忽略群组", subTitle="忽略后,Bot 不再响应指定群组的消息(群组列表将会缓存一小时)", body=cards_curd
|
||||
title="忽略群组",
|
||||
subTitle="忽略后,Bot 不再响应指定群组的消息(群组列表将会缓存一小时)",
|
||||
body=cards_curd,
|
||||
),
|
||||
)
|
||||
|
@ -17,6 +17,7 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from .listen import Client, MessageHandler, Chat, User
|
||||
|
||||
__all__ = ["Client", "MessageHandler", "Chat", "User"]
|
||||
|
@ -377,10 +377,18 @@ class Message(pyrogram.types.Message):
|
||||
is_scheduled: bool = False,
|
||||
replies: int = 1,
|
||||
business_connection_id: str = None,
|
||||
reply_to_message: "pyrogram.raw.base.Message" = None
|
||||
reply_to_message: "pyrogram.raw.base.Message" = None,
|
||||
):
|
||||
parsed = await pyrogram.types.Message.old_parse(
|
||||
client, message, users, chats, topics, is_scheduled, replies, business_connection_id, reply_to_message
|
||||
client,
|
||||
message,
|
||||
users,
|
||||
chats,
|
||||
topics,
|
||||
is_scheduled,
|
||||
replies,
|
||||
business_connection_id,
|
||||
reply_to_message,
|
||||
) # noqa
|
||||
# make message.text as message.caption
|
||||
parsed.text = parsed.text or parsed.caption
|
||||
@ -407,8 +415,8 @@ class Message(pyrogram.types.Message):
|
||||
"pyrogram.types.InlineKeyboardMarkup",
|
||||
"pyrogram.types.ReplyKeyboardMarkup",
|
||||
"pyrogram.types.ReplyKeyboardRemove",
|
||||
"pyrogram.types.ForceReply"
|
||||
] = object
|
||||
"pyrogram.types.ForceReply",
|
||||
] = object,
|
||||
) -> Union["pyrogram.types.Message", List["pyrogram.types.Message"]]:
|
||||
if self.media:
|
||||
self.text = None
|
||||
|
@ -17,6 +17,7 @@ GNU General Public License for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with pyromod. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
from .utils import patch, patchable
|
||||
|
||||
__all__ = ["patch", "patchable"]
|
||||
|
Loading…
Reference in New Issue
Block a user