♻️ Reformat All Plugins
All checks were successful
Github commit to telegram / build (push) Successful in 13s

This commit is contained in:
xtaodada 2024-09-28 22:35:08 +08:00
parent 179e809f4e
commit fb5a3f5baf
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
67 changed files with 177 additions and 130 deletions

2
.gitignore vendored
View File

@ -137,3 +137,5 @@ dmypy.json
# Pyright config # Pyright config
pyrightconfig.json pyrightconfig.json
pagermaid/

View File

@ -1,8 +1,10 @@
""" PagerMaid module that 抽象中文 """ """ PagerMaid module that 抽象中文 """
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import lang, Message, pip_install from pagermaid.utils import lang, pip_install
pip_install("jieba") pip_install("jieba")
pip_install("pinyin") pip_install("pinyin")

View File

@ -7,7 +7,8 @@ from pyrogram import Client
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.services import sqlite, bot from pagermaid.services import sqlite, bot
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import edit_delete, pip_install, lang from pagermaid.utils import pip_install, lang
from pagermaid.utils.bot_utils import edit_delete
pip_install("snownlp") pip_install("snownlp")

View File

@ -4,13 +4,14 @@ from datetime import datetime
from pyrogram.errors import FloodWait from pyrogram.errors import FloodWait
from pagermaid import scheduler from pagermaid.dependence import scheduler
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.services import client as request, sqlite, bot from pagermaid.services import client as request, sqlite, bot
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.sub_utils import Sub from pagermaid.utils import Sub
from pagermaid.utils import check_manage_subs, edit_delete from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import check_manage_subs
class AliCloud: class AliCloud:

View File

@ -2,12 +2,12 @@
自动回复Emoji插件 自动回复Emoji插件
Author: SuperManito Author: SuperManito
""" """
from pagermaid.dependence import sqlite
from pagermaid import bot, log
from pagermaid.single_utils import sqlite
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.utils import lang, edit_delete, pip_install from pagermaid.services import bot
from pagermaid.utils import lang, pip_install
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils.bot_utils import edit_delete, log
pip_install("emoji") pip_install("emoji")

View File

@ -17,9 +17,10 @@ from pyrogram.raw.types import (
InputDocument, InputDocument,
) )
from pagermaid import bot from pagermaid.dependence import sqlite
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import sqlite, Message from pagermaid.services import bot
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pyromod.utils.conversation import Conversation from pyromod.utils.conversation import Conversation

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import contextlib import contextlib
from asyncio import sleep
from typing import Optional, List, Dict, Tuple, Union from typing import Optional, List, Dict, Tuple, Union
from functools import reduce from functools import reduce
@ -8,12 +9,13 @@ from pyrogram.raw.functions.messages import SendReaction
from pyrogram.raw.types import ReactionEmoji, ReactionCustomEmoji, User from pyrogram.raw.types import ReactionEmoji, ReactionCustomEmoji, User
from pyrogram.types import MessageEntity from pyrogram.types import MessageEntity
from pagermaid.dependence import sqlite
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.utils import sleep, pip_install from pagermaid.utils import pip_install
from pagermaid.single_utils import sqlite
pip_install("emoji") pip_install("emoji")
import emoji import emoji
NATIVE_EMOJI = b"\xf0\x9f\x91\x8d\xf0\x9f\x91\x8e\xe2\x9d\xa4\xef\xb8\x8f\xf0\x9f\x94\xa5\xf0\x9f\xa5\xb0\xf0\x9f\x91\x8f\xf0\x9f\x98\x81\xf0\x9f\xa4\x94\xf0\x9f\xa4\xaf\xf0\x9f\x98\xb1\xf0\x9f\xa4\xac\xf0\x9f\x98\xa2\xf0\x9f\x8e\x89\xf0\x9f\xa4\xa9\xf0\x9f\xa4\xae\xf0\x9f\x92\xa9\xf0\x9f\x99\x8f\xf0\x9f\x91\x8c\xf0\x9f\x95\x8a\xf0\x9f\xa4\xa1\xf0\x9f\xa5\xb1\xf0\x9f\xa5\xb4\xf0\x9f\x98\x8d\xf0\x9f\x90\xb3\xe2\x9d\xa4\xef\xb8\x8f\xe2\x80\x8d\xf0\x9f\x94\xa5\xf0\x9f\x8c\x9a\xf0\x9f\x8c\xad\xf0\x9f\x92\xaf\xf0\x9f\xa4\xa3\xe2\x9a\xa1\xef\xb8\x8f\xf0\x9f\x8d\x8c\xf0\x9f\x8f\x86\xf0\x9f\x92\x94\xf0\x9f\xa4\xa8\xf0\x9f\x98\x90\xf0\x9f\x8d\x93\xf0\x9f\x8d\xbe\xf0\x9f\x92\x8b\xf0\x9f\x96\x95\xf0\x9f\x98\x88\xf0\x9f\x98\x82\xf0\x9f\x98\xad".decode() NATIVE_EMOJI = b"\xf0\x9f\x91\x8d\xf0\x9f\x91\x8e\xe2\x9d\xa4\xef\xb8\x8f\xf0\x9f\x94\xa5\xf0\x9f\xa5\xb0\xf0\x9f\x91\x8f\xf0\x9f\x98\x81\xf0\x9f\xa4\x94\xf0\x9f\xa4\xaf\xf0\x9f\x98\xb1\xf0\x9f\xa4\xac\xf0\x9f\x98\xa2\xf0\x9f\x8e\x89\xf0\x9f\xa4\xa9\xf0\x9f\xa4\xae\xf0\x9f\x92\xa9\xf0\x9f\x99\x8f\xf0\x9f\x91\x8c\xf0\x9f\x95\x8a\xf0\x9f\xa4\xa1\xf0\x9f\xa5\xb1\xf0\x9f\xa5\xb4\xf0\x9f\x98\x8d\xf0\x9f\x90\xb3\xe2\x9d\xa4\xef\xb8\x8f\xe2\x80\x8d\xf0\x9f\x94\xa5\xf0\x9f\x8c\x9a\xf0\x9f\x8c\xad\xf0\x9f\x92\xaf\xf0\x9f\xa4\xa3\xe2\x9a\xa1\xef\xb8\x8f\xf0\x9f\x8d\x8c\xf0\x9f\x8f\x86\xf0\x9f\x92\x94\xf0\x9f\xa4\xa8\xf0\x9f\x98\x90\xf0\x9f\x8d\x93\xf0\x9f\x8d\xbe\xf0\x9f\x92\x8b\xf0\x9f\x96\x95\xf0\x9f\x98\x88\xf0\x9f\x98\x82\xf0\x9f\x98\xad".decode()

View File

@ -1,6 +1,6 @@
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import safe_remove
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.utils import safe_remove
async def get_audio(message: Message): async def get_audio(message: Message):

View File

@ -1,14 +1,15 @@
""" Module to automate message deletion. """ """ Module to automate message deletion. """
import traceback import traceback
from asyncio import sleep
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from pagermaid.utils import pip_install
from pagermaid.dependence import scheduler
from pagermaid.services import bot
from pagermaid.utils import pip_install, logs
pip_install("emoji") pip_install("emoji")
from emoji import emojize from emoji import emojize
from pagermaid import logs, scheduler, bot
auto_change_name_init = False auto_change_name_init = False

View File

@ -1,7 +1,7 @@
import contextlib import contextlib
from pagermaid.dependence import add_delete_message_job
from pagermaid.services import sqlite from pagermaid.services import sqlite
from pagermaid.scheduler import add_delete_message_job
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import alias_command from pagermaid.utils import alias_command

View File

@ -1,11 +1,12 @@
import contextlib import contextlib
from pagermaid.dependence import sqlite
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.single_utils import sqlite
@Hook.command_postprocessor() @Hook.command_postprocessor()
async def auto_delete(client: Client, message: Message, command: str, sub_command: str): async def auto_delete(client: Client, message: Message, command: str, _: str):
if command in [ if command in [
"lang", "lang",
"alias", "alias",
@ -38,9 +39,11 @@ async def auto_delete(client: Client, message: Message, command: str, sub_comman
]: ]:
async for msg in client.get_chat_history(message.chat.id, limit=100): async for msg in client.get_chat_history(message.chat.id, limit=100):
if msg.from_user and msg.from_user.is_self: if msg.from_user and msg.from_user.is_self:
msg: "Message"
await msg.delay_delete(120) await msg.delay_delete(120)
break break
@Hook.on_startup() @Hook.on_startup()
async def auto_delete_on_startup(client: Client): async def auto_delete_on_startup(client: Client):
data = sqlite.get("exit_msg", {}) data = sqlite.get("exit_msg", {})

View File

@ -1,6 +1,7 @@
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message
from base64 import b64decode, b64encode from base64 import b64decode, b64encode

View File

@ -11,8 +11,10 @@ from datetime import datetime
from sys import executable from sys import executable
import urllib.request import urllib.request
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, pip_install from pagermaid.utils import pip_install
pip_install("binance-connector", alias="binance") pip_install("binance-connector", alias="binance")
pip_install("xmltodict") pip_install("xmltodict")

View File

@ -1,8 +1,10 @@
import json import json
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, pip_install from pagermaid.utils import pip_install
pip_install("requests") pip_install("requests")

View File

@ -2,9 +2,10 @@ import secrets
from os import sep from os import sep
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove from pagermaid.utils import safe_remove
from pagermaid.utils import client
async def get_wallpaper_url(num): async def get_wallpaper_url(num):

View File

@ -1,6 +1,8 @@
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, execute from pagermaid.utils import execute
@listener( @listener(

View File

@ -10,9 +10,10 @@ from pyrogram.enums import ChatType
from pyrogram.errors import FloodWait, UsernameNotOccupied, UsernameInvalid from pyrogram.errors import FloodWait, UsernameNotOccupied, UsernameInvalid
from pyrogram.types import Chat from pyrogram.types import Chat
from pagermaid import bot from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove from pagermaid.services import bot
from pagermaid.utils import safe_remove
async def export_chat_to_csv(): async def export_chat_to_csv():

View File

@ -1,10 +1,10 @@
import contextlib import contextlib
from pagermaid import log from pagermaid.dependence import add_delete_message_job
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.scheduler import add_delete_message_job
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pagermaid.utils.bot_utils import log
@listener( @listener(

View File

@ -6,8 +6,9 @@
""" """
from pyrogram import Client from pyrogram import Client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message
from pyrogram.enums import ParseMode from pyrogram.enums import ParseMode

View File

@ -1,6 +1,9 @@
from pyrogram import Client from pyrogram import Client
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client, edit_delete from pagermaid.utils.bot_utils import edit_delete
@listener(command="diss", description="儒雅随和版祖安语录。") @listener(command="diss", description="儒雅随和版祖安语录。")

View File

@ -2,10 +2,10 @@
import contextlib import contextlib
from pagermaid import read_context
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener, _lock from pagermaid.listener import listener, _lock
from pagermaid.modules.prune import self_prune from pagermaid.modules.prune import self_prune
from pagermaid.static import read_context
from pagermaid.utils import lang from pagermaid.utils import lang

View File

@ -10,9 +10,10 @@ from pyrogram.enums import MessageEntityType
from pyrogram.errors import UsernameNotOccupied, UsernameInvalid from pyrogram.errors import UsernameNotOccupied, UsernameInvalid
from pyrogram.types import User, Chat from pyrogram.types import User, Chat
from pagermaid.single_utils import sqlite, safe_remove from pagermaid.dependence import sqlite, client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import client, Message, lang from pagermaid.utils import lang, safe_remove
from collections import defaultdict from collections import defaultdict
import json import json

View File

@ -10,9 +10,10 @@ from pyrogram.raw.functions.messages import GetEmojiStickers, UninstallStickerSe
from pyrogram.raw.functions.messages import InstallStickerSet from pyrogram.raw.functions.messages import InstallStickerSet
from pyrogram.raw.types import InputStickerSetShortName from pyrogram.raw.types import InputStickerSetShortName
from pagermaid import bot from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove from pagermaid.services import bot
from pagermaid.utils import safe_remove
class NoStickerSetError(Exception): class NoStickerSetError(Exception):

View File

@ -3,9 +3,10 @@ import sys
from pytz import timezone from pytz import timezone
from datetime import datetime from datetime import datetime
from pagermaid.utils import client from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove from pagermaid.utils import safe_remove
async def get_epic_games(): async def get_epic_games():

View File

@ -7,14 +7,16 @@ from typing import Optional, Dict
from pyrogram import Client from pyrogram import Client
from pyrogram.enums.parse_mode import ParseMode from pyrogram.enums.parse_mode import ParseMode
from pagermaid import scheduler
from pagermaid import bot from pagermaid.dependence import client, scheduler
from pagermaid.enums import Message
from pagermaid.group_manager import enforce_permission from pagermaid.group_manager import enforce_permission
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.modules.help import from_msg_get_sudo_uid from pagermaid.modules.help import from_msg_get_sudo_uid
from pagermaid.utils import client, Message, from_self, edit_delete from pagermaid.services import bot
from pagermaid.single_utils import safe_remove from pagermaid.utils import Sub, safe_remove
from pagermaid.sub_utils import Sub from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import from_self
everyday_en_sub = Sub("everyday_en") everyday_en_sub = Sub("everyday_en")
everyday_en_data_cache: Optional[Dict] = None everyday_en_data_cache: Optional[Dict] = None

View File

@ -1,9 +1,12 @@
import secrets import secrets
from pagermaid import bot, scheduler from pagermaid.dependence import scheduler
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, edit_delete, check_manage_subs from pagermaid.services import bot
from pagermaid.sub_utils import Sub from pagermaid.utils import Sub
from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import check_manage_subs
everyday_greet_sub = Sub("everyday_greet") everyday_greet_sub = Sub("everyday_greet")
everyday_greet_data = { everyday_greet_data = {

View File

@ -4,11 +4,12 @@
from secrets import choice from secrets import choice
from pagermaid import log, Config from pagermaid.config import Config
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.services import client as request, scheduler from pagermaid.services import client as request, scheduler
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.utils.bot_utils import log
class FaDian: class FaDian:

View File

@ -10,10 +10,10 @@ from pyrogram.raw.types import InputStickerSetShortName
from pyrogram.raw.types.messages import StickerSet from pyrogram.raw.types.messages import StickerSet
from pyrogram.types import Document, Sticker from pyrogram.types import Document, Sticker
from pagermaid import working_dir
from pagermaid.enums import Message, Client from pagermaid.enums import Message, Client
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import safe_remove from pagermaid.static import working_dir
from pagermaid.utils import safe_remove
async def download_stickers(bot: Client, message: Message, sticker: Sticker): async def download_stickers(bot: Client, message: Message, sticker: Sticker):

View File

@ -1,7 +1,8 @@
from pagermaid import Config, log from pagermaid.config import Config
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.utils import lang, pip_install from pagermaid.utils import lang, pip_install
from pagermaid.utils.bot_utils import log
pip_install("magic-google", alias="magic_google") pip_install("magic-google", alias="magic_google")

View File

@ -1,11 +1,11 @@
""" """
Pagermaid_Pyro group message history query plugin. Plugin by @tom-snow (@caiji_shiwo) Pagermaid_Pyro group message history query plugin. Plugin by @tom-snow (@caiji_shiwo)
""" """
from pagermaid import log
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pagermaid.config import Config from pagermaid.config import Config
from pagermaid.utils.bot_utils import log
class HisMsg: class HisMsg:

View File

@ -2,8 +2,8 @@ import contextlib
from pyrogram.raw.functions.account import UpdateStatus from pyrogram.raw.functions.account import UpdateStatus
from pagermaid import log
from pagermaid.services import bot, scheduler from pagermaid.services import bot, scheduler
from pagermaid.utils.bot_utils import log
@scheduler.scheduled_job("interval", seconds=55, id="keep_online") @scheduler.scheduled_job("interval", seconds=55, id="keep_online")

View File

@ -9,10 +9,10 @@ from pyrogram.enums import ParseMode
from pyrogram.types import ChatPermissions, Chat from pyrogram.types import ChatPermissions, Chat
from pyrogram.types.user_and_chats.user import Link from pyrogram.types.user_and_chats.user import Link
from pagermaid import bot from pagermaid.dependence import sqlite, add_delete_message_job
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import sqlite, Message from pagermaid.services import bot
from pagermaid.scheduler import add_delete_message_job
class KeywordTask: class KeywordTask:

View File

@ -1,12 +1,12 @@
import contextlib import contextlib
import secrets import secrets
from pagermaid import bot, log from pagermaid.dependence import add_delete_message_job
from pagermaid.utils import alias_command from pagermaid.enums import Message
from pagermaid.services import bot
from pagermaid.utils import alias_command, Sub
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message from pagermaid.utils.bot_utils import log
from pagermaid.sub_utils import Sub
from pagermaid.scheduler import add_delete_message_job
lottery_bot = Sub("lottery_bot") lottery_bot = Sub("lottery_bot")
lottery_json = { lottery_json = {

View File

@ -10,13 +10,14 @@ from pyrogram.raw.types import InputStickerSetShortName
from pyrogram.raw.types.messages import StickerSet from pyrogram.raw.types.messages import StickerSet
from pyrogram.types import Document from pyrogram.types import Document
from pagermaid.dependence import add_delete_message_job
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.scheduler import add_delete_message_job
from pagermaid.services import bot, scheduler from pagermaid.services import bot, scheduler
from pagermaid.utils import edit_delete, check_manage_subs from pagermaid.utils import Sub
from pagermaid.sub_utils import Sub from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import check_manage_subs
lu_xiao_xun_bs_sub = Sub("luxiaoxunbs") lu_xiao_xun_bs_sub = Sub("luxiaoxunbs")
lu_xiao_xun_sticker: Optional[StickerSet] = None lu_xiao_xun_sticker: Optional[StickerSet] = None

View File

@ -4,13 +4,16 @@ from os import sep
from pyrogram import Client from pyrogram import Client
from pyrogram.enums.parse_mode import ParseMode from pyrogram.enums.parse_mode import ParseMode
from pagermaid import scheduler
from pagermaid import bot from pagermaid.dependence import client, scheduler
from pagermaid.enums import Message
from pagermaid.group_manager import enforce_permission from pagermaid.group_manager import enforce_permission
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.modules.help import from_msg_get_sudo_uid from pagermaid.modules.help import from_msg_get_sudo_uid
from pagermaid.utils import client, Message, from_self, edit_delete from pagermaid.services import bot
from pagermaid.sub_utils import Sub from pagermaid.utils import Sub
from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import from_self
moyu_sub = Sub("moyu") moyu_sub = Sub("moyu")

View File

@ -3,9 +3,9 @@
from pyrogram.errors import YouBlockedUser from pyrogram.errors import YouBlockedUser
from pyrogram import filters from pyrogram import filters
from pagermaid import bot
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.services import bot
from pagermaid.utils import alias_command from pagermaid.utils import alias_command

View File

@ -1,6 +1,8 @@
from pyrogram import Client from pyrogram import Client
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client
@listener(command="news", description="每日新闻、历史上的今天、天天成语、慧语香风、诗歌天地") @listener(command="news", description="每日新闻、历史上的今天、天天成语、慧语香风、诗歌天地")

View File

@ -5,14 +5,16 @@ from os import sep
from os.path import isfile from os.path import isfile
from typing import Optional from typing import Optional
from pagermaid import scheduler from pagermaid.dependence import scheduler
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.services import bot, client from pagermaid.services import bot, client
from pagermaid.sub_utils import Sub
from pagermaid.utils import check_manage_subs, edit_delete
from pyrogram.enums.parse_mode import ParseMode from pyrogram.enums.parse_mode import ParseMode
from pagermaid.utils import Sub
from pagermaid.utils.bot_utils import edit_delete
from pagermaid.utils.listener import check_manage_subs
CACHE_PATH = f"data{sep}news60s.png" CACHE_PATH = f"data{sep}news60s.png"
news60s_sub = Sub("news60s") news60s_sub = Sub("news60s")

View File

@ -2,8 +2,7 @@ from pyrogram.raw.functions.messages import ReadMentions
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.sub_utils import Sub from pagermaid.utils import lang, Sub
from pagermaid.utils import lang
from pyromod import require_mod_version from pyromod import require_mod_version

View File

@ -9,10 +9,9 @@ from pyrogram.raw.functions.messages import ReadReactions
from pyrogram.raw.types import UpdateMessageReactions, PeerChannel, PeerChat, PeerUser from pyrogram.raw.types import UpdateMessageReactions, PeerChannel, PeerChat, PeerUser
from pagermaid.services import bot from pagermaid.services import bot
from pagermaid.sub_utils import Sub
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import lang from pagermaid.utils import lang, Sub
no_reactions_sub = Sub("no_reactions") no_reactions_sub = Sub("no_reactions")

View File

@ -4,9 +4,9 @@ import contextlib
from pyrogram.types import ChatPermissions from pyrogram.types import ChatPermissions
from pagermaid.dependence import add_delete_message_job
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.scheduler import add_delete_message_job
@listener( @listener(

View File

@ -6,11 +6,10 @@ from pyrogram.errors import PhotoCropSizeSmall, ImageProcessFailed, BadRequest
from pyrogram.raw.functions.photos import UploadContactProfilePhoto from pyrogram.raw.functions.photos import UploadContactProfilePhoto
from pyrogram.raw.types import InputUser from pyrogram.raw.types import InputUser
from pagermaid import Config from pagermaid.config import Config
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import safe_remove from pagermaid.utils import lang, safe_remove
from pagermaid.utils import lang
async def get_photo(message: Message) -> Optional[str]: async def get_photo(message: Message) -> Optional[str]:

View File

@ -8,12 +8,11 @@ from dataclasses import dataclass
from typing import Any, Awaitable, Callable, Dict, List, NamedTuple, Optional, Tuple from typing import Any, Awaitable, Callable, Dict, List, NamedTuple, Optional, Tuple
import yaml import yaml
from pagermaid import logs
from pagermaid.common.reload import reload_all from pagermaid.common.reload import reload_all
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.services import scheduler from pagermaid.services import scheduler
from pagermaid.utils import alias_command, pip_install from pagermaid.utils import alias_command, pip_install, logs
def install_dependencies() -> None: def install_dependencies() -> None:

View File

@ -36,12 +36,12 @@ from pyrogram.raw.functions.channels import UpdateUsername
from pyrogram.raw.types import GlobalPrivacySettings from pyrogram.raw.types import GlobalPrivacySettings
from pyrogram.types import User, Sticker from pyrogram.types import User, Sticker
from pagermaid import bot, logs
from pagermaid.config import Config from pagermaid.config import Config
from pagermaid.dependence import sqlite
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import sqlite from pagermaid.services import bot
from pagermaid.sub_utils import Sub from pagermaid.utils import alias_command, Sub
from pagermaid.utils import Message, alias_command
cmd_name = "pmcaptcha" cmd_name = "pmcaptcha"
@ -67,7 +67,7 @@ async def log(message: str, remove_prefix: bool = False):
def get_version(): def get_version():
from pagermaid import working_dir from pagermaid.static import working_dir
from os import sep from os import sep
from json import load from json import load

View File

@ -5,9 +5,8 @@
@Date 2022/6/23 21:57 @Date 2022/6/23 21:57
""" """
from pyrogram import Client from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client
from pyrogram.enums import ChatMemberStatus, ParseMode from pyrogram.enums import ChatMemberStatus, ParseMode

View File

@ -1,11 +1,12 @@
""" QR Code related utilities. """ """ QR Code related utilities. """
from PIL import Image from PIL import Image
from pagermaid import log, Config
from pagermaid.config import Config
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import safe_remove from pagermaid.utils import lang, pip_install, safe_remove
from pagermaid.utils import lang, pip_install from pagermaid.utils.bot_utils import log
pip_install("pyqrcode") pip_install("pyqrcode")
pip_install("pypng") pip_install("pypng")

View File

@ -2,13 +2,13 @@
from json.decoder import JSONDecodeError from json.decoder import JSONDecodeError
from pagermaid import log
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.services import client, scheduler from pagermaid.services import client, scheduler
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.config import Config from pagermaid.config import Config
from pagermaid.utils.bot_utils import log
class Rate: class Rate:

View File

@ -11,12 +11,12 @@ from pyrogram.errors import (
) )
from pyrogram.types import Chat from pyrogram.types import Chat
from pagermaid import log from pagermaid.dependence import add_delete_message_job
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.scheduler import add_delete_message_job
from pagermaid.services import bot from pagermaid.services import bot
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.utils import lang from pagermaid.utils import lang
from pagermaid.utils.bot_utils import log
def mention_group(chat: Chat): def mention_group(chat: Chat):

View File

@ -3,10 +3,10 @@ import datetime
from typing import Optional, List from typing import Optional, List
from pagermaid import bot from pagermaid.dependence import scheduler, sqlite
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.scheduler import scheduler from pagermaid.services import bot
from pagermaid.single_utils import sqlite, Message
from pagermaid.utils import alias_command from pagermaid.utils import alias_command

View File

@ -4,11 +4,11 @@ import pytz
from typing import Optional, List from typing import Optional, List
from pagermaid import bot
from pagermaid.config import Config from pagermaid.config import Config
from pagermaid.dependence import scheduler, sqlite
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.scheduler import scheduler from pagermaid.services import bot
from pagermaid.single_utils import sqlite, Message
from pagermaid.utils import alias_command from pagermaid.utils import alias_command

View File

@ -8,10 +8,10 @@ from pyrogram.enums import ChatType
from pyrogram.raw.functions.account import GetAuthorizations, ResetAuthorization from pyrogram.raw.functions.account import GetAuthorizations, ResetAuthorization
from pyrogram.raw.types import Authorization from pyrogram.raw.types import Authorization
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message from pagermaid.services import bot
from pagermaid.utils import alias_command from pagermaid.utils import alias_command
from pagermaid import bot
async def get_all_session() -> List[Authorization]: async def get_all_session() -> List[Authorization]:

View File

@ -11,12 +11,13 @@ from pyrogram.enums import ChatType
from pyrogram.errors import FloodWait from pyrogram.errors import FloodWait
from pyrogram.types import Chat from pyrogram.types import Chat
from pagermaid import log, Config from pagermaid.config import Config
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.enums.command import CommandHandler from pagermaid.enums.command import CommandHandler
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.services import bot, scheduler, sqlite, logs from pagermaid.services import bot, scheduler, sqlite
from pagermaid.utils import lang from pagermaid.utils import lang, logs
from pagermaid.utils.bot_utils import log
WHITELIST = [-1001441461877] WHITELIST = [-1001441461877]
AVAILABLE_OPTIONS_TYPE = Literal["silent", "text", "all", "photo", "document", "video"] AVAILABLE_OPTIONS_TYPE = Literal["silent", "text", "all", "photo", "document", "video"]

View File

@ -1,8 +1,8 @@
from asyncio import sleep from asyncio import sleep
from pagermaid.dependence import sqlite, client
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.single_utils import sqlite
from pagermaid.utils import client, edit_delete
# from pagermaid import bot # from pagermaid import bot
from pyrogram.enums.chat_type import ChatType from pyrogram.enums.chat_type import ChatType
@ -13,6 +13,8 @@ from pyrogram.types import ChatPermissions
import json import json
from pagermaid.utils.bot_utils import edit_delete
class SillyGirl: class SillyGirl:
address = "" address = ""

View File

@ -5,9 +5,8 @@ from os.path import exists
from httpx import ReadTimeout from httpx import ReadTimeout
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import safe_remove
from pagermaid.enums import Client, Message, AsyncClient from pagermaid.enums import Client, Message, AsyncClient
from pagermaid.utils import lang, pip_install from pagermaid.utils import lang, pip_install, safe_remove
pip_install("speedtest-cli", alias="speedtest") pip_install("speedtest-cli", alias="speedtest")

View File

@ -17,8 +17,7 @@ from pyrogram.file_id import FileId
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.services import bot, sqlite from pagermaid.services import bot, sqlite
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.single_utils import safe_remove from pagermaid.utils import alias_command, safe_remove
from pagermaid.utils import alias_command
class CannotToStickerSetError(Exception): class CannotToStickerSetError(Exception):

View File

@ -2,7 +2,7 @@ from PIL import Image
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message, Client from pagermaid.enums import Message, Client
from pagermaid.single_utils import safe_remove from pagermaid.utils import safe_remove
@listener( @listener(

View File

@ -10,9 +10,10 @@ from pyrogram.raw.functions.messages import GetAllStickers, UninstallStickerSet
from pyrogram.raw.functions.messages import InstallStickerSet from pyrogram.raw.functions.messages import InstallStickerSet
from pyrogram.raw.types import InputStickerSetShortName from pyrogram.raw.types import InputStickerSetShortName
from pagermaid import bot from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove from pagermaid.services import bot
from pagermaid.utils import safe_remove
class NoStickerSetError(Exception): class NoStickerSetError(Exception):

View File

@ -1,6 +1,5 @@
from pagermaid.enums import AsyncClient from pagermaid.enums import AsyncClient, Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message
@listener(command="tel", description="手机号码归属地等信息查询。") @listener(command="tel", description="手机号码归属地等信息查询。")

View File

@ -2,8 +2,9 @@ from asyncio import sleep
from pyrogram.errors.exceptions.bad_request_400 import MessageNotModified from pyrogram.errors.exceptions.bad_request_400 import MessageNotModified
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import lang, Message from pagermaid.utils import lang
@listener( @listener(

View File

@ -8,9 +8,9 @@ from pyrogram.errors import (
) )
from pyrogram.types import Chat from pyrogram.types import Chat
from pagermaid import bot
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Client, Message from pagermaid.enums import Client, Message
from pagermaid.services import bot
from pagermaid.utils import lang from pagermaid.utils import lang

View File

@ -2,8 +2,8 @@ import contextlib
from pyrogram import filters from pyrogram import filters
from pagermaid.enums import Message
from pagermaid.listener import raw_listener from pagermaid.listener import raw_listener
from pagermaid.single_utils import Message
@raw_listener(filters.private & filters.voice & filters.incoming) @raw_listener(filters.private & filters.voice & filters.incoming)

View File

@ -1,7 +1,9 @@
import datetime import datetime
from pyrogram import Client from pyrogram import Client
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client
icons = { icons = {
"01d": "🌞", "01d": "🌞",

View File

@ -1,6 +1,6 @@
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message, AsyncClient from pagermaid.enums import Message, AsyncClient
from pagermaid.single_utils import safe_remove from pagermaid.utils import safe_remove
@listener(command="weather_lite", description="查询天气", parameters="[城市]") @listener(command="weather_lite", description="查询天气", parameters="[城市]")

View File

@ -3,13 +3,13 @@ import json
from asyncio import sleep from asyncio import sleep
from pagermaid import log from pagermaid.dependence import sqlite
from pagermaid.hook import Hook from pagermaid.hook import Hook
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.services import bot from pagermaid.services import bot
from pagermaid.single_utils import sqlite
from pagermaid.utils import pip_install from pagermaid.utils import pip_install
from pagermaid.utils.bot_utils import log
pip_install("aiohttp") pip_install("aiohttp")

View File

@ -1,6 +1,8 @@
from pyrogram import Client from pyrogram import Client
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client
@listener(command="whois", description="查看域名是否已被注册、注册日期、过期日期、域名状态、DNS解析服务器等。") @listener(command="whois", description="查看域名是否已被注册、注册日期、过期日期、域名状态、DNS解析服务器等。")

View File

@ -13,11 +13,11 @@ from urllib import parse
from pyrogram.enums import ChatType from pyrogram.enums import ChatType
from pagermaid import bot, scheduler from pagermaid.dependence import sqlite, client, scheduler
from pagermaid.enums import Message from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.single_utils import Message, safe_remove, sqlite from pagermaid.services import bot
from pagermaid.utils import alias_command, client from pagermaid.utils import alias_command, safe_remove
cmd_name = "xinjingdailybot" cmd_name = "xinjingdailybot"
alias_cmd_name = alias_command(cmd_name) alias_cmd_name = alias_command(cmd_name)

View File

@ -1,8 +1,9 @@
import json import json
from pyrogram import Client from pyrogram import Client
from pagermaid.dependence import client
from pagermaid.enums import Message
from pagermaid.listener import listener from pagermaid.listener import listener
from pagermaid.utils import Message, client
@listener( @listener(