Exemplo n.º 1
0
async def backup():
    bot = get_bot()
    await bot.send_group_msg(
        group_id=383647564,
        message=cq.at("all") + """٩( °༥° )و ₎₎能动手就别吵吵
开始击剑了,兄弟萌!!淦死野人!!""" + cq.image("a.gif"),
    )
Exemplo n.º 2
0
async def backup():
    bot = get_bot()
    ls = await bot.get_group_member_list(group_id=bot.config.group,
                                         self_id=3418961367)
    await Backup.delete.gino.all()
    for item in ls:
        await Backup.create(qid=item["user_id"],
                            card=item["card"],
                            role=item["role"])
Exemplo n.º 3
0
async def _():
    bot = get_bot()
    values = await Mg.query.where(Mg.morningcall == True).gino.all()
    for item in values:
        item = item.gid
        try:
            await bot.send_group_msg(group_id=int(item),
                                     message=f"Ciallo~(∠・ω< )⌒★,早上好。")
        except (ActionFailed, ApiNotAvailable, NetworkError, RequestDenied):
            pass
Exemplo n.º 4
0
async def boss_notice(max_num: int = -1):

    bot = get_bot()
    ress = [(["暂时没有公会报表哦!"], "Grab Rss Error!", "", "",)]

    if bot.config.cookies:
        headers = {
            "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36",
            "Cookie": bot.config.cookies,
            "Host": "www.bigfun.cn",
            "Referer": "https://www.bigfun.cn/tools/pcrteam/d_report",
        }
    else:
        return ress

    async with bot.config.session.get(
        "https://www.bigfun.cn/api/feweb?target=gzlj-clan-day-report%2Fa&date={}&size=30".format(
            datetime.today().strftime("%Y-%m-%d")
        ),
        headers=headers,
    ) as resp:
        if resp.status != 200:
            return ress
        ShitJson = await resp.json()
        ShitJson = ShitJson["data"]
        try:
            ls = [
                item
                for per in ShitJson
                for item in per["damage_list"]
                if item["kill"] == 1
            ]
            ls.sort(key=itemgetter("datetime"), reverse=True)
        except Exception as e:
            return ress

    ress = [
        (
            [cq.at("all") + "{} 倒了".format(i["boss_name"])],
            str(i["datetime"]),
            "",
            cq.at("all") + "{} 倒了".format(i["boss_name"]),
        )
        for i in ls
        if i["kill"] == 1
    ]

    return ress
Exemplo n.º 5
0
async def _():
    bot = get_bot()
    loop = asyncio.get_event_loop()
    values = await Mg.query.where(Mg.rss == True).gino.all()
    values = [int(item.gid) for item in values]
    for key in doc:
        if key == "boss_notice":
            is_ghz = await Mg.query.where((Mg.ghz == True) &
                                          (Mg.gid == 145029700)).gino.first()
            if is_ghz == None:
                continue
        if key in NOUPDATE or "pixiv" in key:
            continue
        asyncio.run_coroutine_threadsafe(
            handlerss(
                bot,
                key,
                gtfun(key),
                key not in NOBROADCAST,
                key in FULLTEXT,
                values,
            ),
            loop,
        )