💄 Format with black 24.x.x

This commit is contained in:
xtaodada 2024-08-13 18:38:13 +08:00
parent b8c54d0cce
commit 299c8db5dd
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
10 changed files with 30 additions and 10 deletions

View File

@ -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):

View File

@ -1,4 +1,5 @@
""" Pagermaid backup and recovery plugin. """
import os
import sys
import tarfile

View File

@ -1,4 +1,5 @@
""" The help module. """
from os import listdir
from pyrogram.enums import ParseMode

View File

@ -1,4 +1,5 @@
""" Pagermaid message plugin. """
from pyrogram.enums import ChatType
from pyrogram.errors import Forbidden, FloodWait

View File

@ -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)))

View File

@ -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)

View File

@ -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,
),
)

View File

@ -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"]

View File

@ -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

View File

@ -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"]