Ejemplo n.º 1
0
from userbot.modules.sql_helper.bot_starters import (
    del_starter_from_db,
    get_all_starters,
)
from userbot.utils import (
    _format,
    asst_cmd,
    edit_delete,
    edit_or_reply,
    man_cmd,
    reply_id,
    time_formatter,
)
from userbot.utils.logger import logging

LOGS = logging.getLogger(__name__)

OWNER_ID = user.id
OWNER = user.first_name
FINISHED_PROGRESS_STR = "●"
UNFINISHED_PROGRESS_STR = "○"


async def get_user_and_reason(event):
    id_reason = event.pattern_match.group(1)
    replied = await reply_id(event)
    user_id, reason = None, None
    if replied:
        users = get_user_id(replied)
        if users is not None:
            for usr in users:
Ejemplo n.º 2
0
import json

import requests

from userbot import BOTLOG_CHATID
from userbot.utils.logger import logging

LOGS = logging.getLogger("ManUserBot")

headers = {
    "User-Agent":
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36",
    "content-type": "application/json",
}


async def p_paste(message, extension=None):
    siteurl = "https://pasty.lus.pm/api/v1/pastes"
    data = {"content": message}
    try:
        response = requests.post(url=siteurl,
                                 data=json.dumps(data),
                                 headers=headers)
    except Exception as e:
        return {"error": str(e)}
    if response.ok:
        response = response.json()
        purl = (f"https://pasty.lus.pm/{response['id']}.{extension}"
                if extension else f"https://pasty.lus.pm/{response['id']}.txt")
        try:
            from userbot import bot