Esempio n. 1
0
async def main():
    for i in range(1, 13):
        Time = int(time.strftime("%I%M%S", time.localtime(time.time())))
        if Time == (i * 10000):
            async with Session(
                    f"mirai://localhost:8080/?authKey={authKey}&qq={qq}"
            ) as session:
                # 向个人报时
                await session.sendFriendMessage(
                    qqID,  # 接受qq
                    [
                        Image.fromFileSystem("./timeimg/{}.jpg".format(
                            int(i))),
                        Plain(text="Now time")
                    ])
                # 在群里报时
                await session.sendGroupMessage(
                    qqID,  # 群组qq
                    [
                        Image.fromFileSystem("./timeimg/{}.jpg".format(
                            int(i))),
                        Plain(text="Now time")
                    ])
                print('{}点已放送'.format(i))
                break
Esempio n. 2
0
 async def send_pic(self, app: Mirai, kind: str, qq_message:QQMessage, pic_path:str):
     print('send pic: ' + pic_path)
     if kind == 'g':
         await app.sendGroupMessage(qq_message.group, [Image.fromFileSystem(pic_path)])
     elif kind == 'f':
         await app.sendFriendMessage(qq_message.friend, [Image.fromFileSystem(pic_path)])
     elif kind == 't':
         await app.sendTempMessage(qq_message.group, qq_message.member, [Image.fromFileSystem(pic_path)])
Esempio n. 3
0
async def daily_pic(app: Mirai, group: Group, member: Member,
                    message: MessageChain):
    matches = ['.setu', '来张色图', '来份色图', '不够色', '就这?']
    if any(x in message.toString() for x in matches):
        ans = random.randint(0, 1)
        if ans:
            try:
                path = os.path.abspath(__file__)
                path = os.path.dirname(path)
                path = os.path.join(path, 'Tornado_webite_test')
                path = os.path.join(path, 'Pixiv')
                # print(path)
                pic_name = os.listdir(path)
                # print(pic_name)
                random_pic = os.path.join(path, random.choice(pic_name))
                await app.sendGroupMessage(group.id, [
                    At(target=member.id),
                    Image.fromFileSystem(random_pic),
                    Plain(text="这是您点的一份色图~")
                ])
            except (RuntimeError, ValueError, EnvironmentError,
                    PermissionError, ConnectionRefusedError):
                print("send setu message error!")
        else:
            await app.sendGroupMessage(group.id, [
                At(target=member.id),
                Plain(text="本烫不想理你"),
                Face(faceId=212),
            ])
Esempio n. 4
0
async def join(app: Mirai, group: Group, member: Member, cp: CommandParser):
    pa = cp.parse_with_valid(["Int"])
    if isinstance(pa, str):
        return await app.sendGroupMessage(group, [At(member.id), Plain(pa)])
    elif not pa:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("参数不能为空")])
    if pa[0][1] not in bind:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("没有找到这个房间")])
    elif member.id in bind:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("你不能加入自己的房间")])
    elif len(room[pa[0][1]]) > 1:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("已经开始了")])
    else:
        room[pa[0][1]].append(member.id)
        state[member.id] = state[pa[0][1]]
        await app.sendGroupMessage(
            group,
            [At(member.id), Plain("加入成功,若图片无法正常加载可输入!cget")])
    await app.sendGroupMessage(group, [
        At(pa[0][1]),
        Image.fromBytes(bind[state[member.id]].get_image()),
        Plain("输入!p x y来放置棋子")
    ])
Esempio n. 5
0
async def setuExecutor(app: Mirai, message: GroupMessage, number: int,
                       keyword: str):
    """根据关键词获取data_array,并调用sendSetu"""
    global LAST_QUOTA
    member_id: int = message.sender.id
    group: Group = message.sender.group
    if keyword == '':
        if len(SetuDatabase.load_from_file().__root__
               ) >= 300 and LAST_QUOTA < 200:
            resp = SetuResp(code=-430, msg='空关键词')
        else:
            resp = await SetuResp.get()
            LAST_QUOTA = resp.quota
    elif cd.check(member_id):
        resp = await SetuResp.get(keyword)
        LAST_QUOTA = resp.quota
    else:
        # resp = SetuResp(code=-3, msg='你的请求太快了,休息一下吧')
        await app.sendGroupMessage(group, [
            At(member_id),
            Plain('太快了,受不了!\n'),
            Image.fromBytes(LoadFrequencyFile())
        ])
        return

    if resp.code == 0:
        cd.update(member_id)
        await sendSetu(app, message, resp.data, number)
    elif resp.code in [429, -430]:
        db = SetuDatabase.load_from_file()
        await sendSetu(app, message, db.__root__, number)
    else:
        source: Source = message.messageChain.getSource()
        await app.sendGroupMessage(group, resp.msg, source)
Esempio n. 6
0
def mati(message, **kw_args):
    context = kw_args["context"] if 'context' in kw_args else {}

    context = _mati_par(message, context)

    name = context['name'] if 'name' in context else None
    if not name:
        # url="https://akaisorani.github.io/QQ-bot-Arknights-Helper/akaisora/plugins/materials"
        # url="https://img.nga.178.com/attachments/mon_202005/16/-klbw3Q5-43dbXeZ3uT3cS2io-1bf.png"
        url = "https://z3.ax1x.com/2021/03/24/6HgIP0.jpg"
        # url="https://arkonegraph.herokuapp.com/"
        app_link = "https://aog.wiki/"

        ret_msg = [
            Image.fromBytes(get_bytes_image_from_url(url)),
            Plain(text=app_link)
        ]
    else:
        return
        # report = get_material_recom(name=name)
        # if report is None: return
        # ret_msg=[
        #     Plain(text=report)
        # ]

    return ret_msg
Esempio n. 7
0
async def CFProblemRender(g, cid, ti):
    FN = 'CF/%s.png' % cid
    print('在%f秒后渲染比赛' % ti + cid + '的问题图片')
    if cid in GLOBAL.CFRenderFlag or os.path.exists(FN):  #有队列在做了
        await asyncio.sleep(ti)
        if not os.path.exists(FN):
            await asyncio.sleep(20)
        await GLOBAL.app.sendGroupMessage(g, [Image.fromFileSystem(FN)])
    else:
        GLOBAL.CFRenderFlag.add(cid)
        await asyncio.sleep(ti)
        base = 'https://codeforces.com/contest/' + cid + '/problems'
        l = renderHtml(base, FN)
        GLOBAL.CFRenderFlag.discard(ti)
        l.append(Image.fromFileSystem(FN))
        await GLOBAL.app.sendGroupMessage(g, l)
Esempio n. 8
0
def 电笔记(*attrs, **kwargs):
    ins = ' '.join(attrs)
    if ins == 'reload':
        ret_msg = [Plain('知识库已更新,现有词条:\n')]
        for i in os.listdir('DigitalElectronicsTech'):
            if i[-6:] == '.json5':
                with open('DigitalElectronicsTech/' + i, 'r') as f:
                    j = json5.load(f)
                for k, v in j.items():
                    ret_msg.append(Plain('\t- ' + k + '\n'))
                    GLOBAL.DEKnowledge[k] = [
                        Plain(f'''{k}\n别名:{v['AN']}\n{v['desc']}''')
                    ]
                    if 'img' in v:
                        for vi in v['img']:
                            GLOBAL.DEKnowledge[k].append(
                                Image.fromFileSystem(
                                    'DigitalElectronicsTech/img/' + vi))
                    for an in v['AN']:
                        GLOBAL.DEKnowledge[an] = GLOBAL.DEKnowledge[k]
        return ret_msg
    elif ins in GLOBAL.DEKnowledge:
        return GLOBAL.DEKnowledge[ins]
    else:
        return [Plain('不存在此条目')]
Esempio n. 9
0
async def msgDistributer(**kwargs):
    """
    根据player号分发消息
    输入字典msg为源文本,typ标识其类型('E'表情,'I'图片文件目录,'P'普通文本)
    """
    if 'msg' in kwargs and kwargs['msg']:
        if kwargs.get('typ', 'P') == 'E':
            seq = [Face(QQFaces[kwargs['msg']])]
        elif kwargs.get('typ', 'P') == 'I':
            f_n = randstr(8)
            with open(f_n, 'wb') as f:
                f.write(kwargs['msg'])
            seq = [Image.fromFileSystem(f_n)]
            # seq = [Image.fromFileSystem(kwargs['msg'])]
        else:
            seq = [Plain(kwargs['msg'])]

        if 'gp' in kwargs:
            await GLOBAL.app.sendGroupMessage(kwargs['gp'], seq)
        elif 'mem' in kwargs:
            await GLOBAL.app.sendFriendMessage(kwargs['mem'], seq)
        elif 'player' in kwargs:
            kwargs['player'] = int(kwargs['player'])
            if kwargs['player'] > 1 << 39:
                await GLOBAL.app.sendGroupMessage(kwargs['player'] - (1 << 39),
                                                  seq)
            else:
                await GLOBAL.app.sendFriendMessage(kwargs['player'], seq)
Esempio n. 10
0
async def GMHandler(app: Mirai, group: Group, member: Member,
                    message: GroupMessage):
    print(message)
    print(message.toString())
    global RECORDS, STATUS
    if "醒醒不对劲" in message.toString():
        STATUS = True
        await app.sendGroupMessage(group, [Plain(text="我还想再睡会儿!")])

    if not STATUS:
        return

    if "报名" in message.toString():
        try:
            message_handler(member, message.toString())
            await app.sendGroupMessage(group, [Plain(text=format_table())])
        except Exception:
            await app.sendGroupMessage(group, [Plain(text="糟糕,坑满啦!")])
    elif "clear" in message.toString():
        RECORDS = {}
        await app.sendGroupMessage(group, [Plain(text=format_table())])
    elif "出来吧憨憨" in message.toString():
        time.sleep(1)
        await app.sendGroupMessage(group, [Plain(text="余目才是憨批!")])
    elif message.toString() == "/roll":
        await app.sendGroupMessage(group,
                                   [Plain(text=str(random.randint(0, 100)))])
    elif "At::target=75960775" in message.toString():
        if random.randint(0, 10) < 4:
            await app.sendGroupMessage(
                group,
                [Plain(text="喊我干啥,我又不是小爱同学"),
                 Face(faceId=QQFaces['nanguo'])])
        else:
            await app.sendGroupMessage(group, [Plain(text=random_words())])
    elif "睡吧不对劲" in message.toString():
        STATUS = False
        await app.sendGroupMessage(group, [
            Plain(text="晚安~"),
            Image(
                type='Image',
                imageId='AD698F3D-FCEC-0516-C6DA-346967FF876E',
                url=HttpUrl(
                    'http://gchat.qpic.cn/gchatpic_new/843452214/1032083209-2934067879-AD698F3DFCEC0516C6DA346967FF876E/0?term=2',
                    scheme='http',
                    host='gchat.qpic.cn',
                    tld='cn',
                    host_type='domain',
                    path=
                    '/gchatpic_new/843452214/1032083209-2934067879-AD698F3DFCEC0516C6DA346967FF876E/0',
                    query='term=2'))
        ])
    else:
        num = random.randint(0, 100)
        if num < 10:
            time.sleep(1)
            await app.sendGroupMessage(group, [Plain(text=random_words())])

    if random.randint(0, 100) < 30 and "At::target" not in message.toString():
        WORDS.append(message.toString())
Esempio n. 11
0
def 爬萌娘(*attrs, **kwargs):
    lnk = 'https://zh.moegirl.org/Special:%E9%9A%8F%E6%9C%BA%E9%A1%B5%E9%9D%A2'
    if len(attrs):
        keyWord = ' '.join(attrs)
        r = requests.get(
            'https://zh.moegirl.org/index.php?title=Special:搜索&go=前往&search=' +
            keyWord,
            headers=GLOBAL.moeGirlHeaders)
        r.encoding = 'utf-8'
        s = BeautifulSoup(r.text, 'html.parser')
        res = s.find('ul', attrs={'class': 'mw-search-results'})
        if res is None:
            if len(r.history):
                lnk = r.url
            else:
                tlnk = 'https://zh.moegirl.org/' + keyWord
                if requests.get(tlnk).status_code == 404:
                    return [Plain(text=random.choice(['这不萌娘', '在萌娘找不到这玩意']))]
                else:
                    lnk = tlnk
        else:
            lnk = 'https://zh.moegirl.org' + res.find('a')['href']
    save_fn = randstr(GLOBAL.randomStrLength) + "tmpMoe" + str(
        kwargs['mem'].id) + '.png'
    l = renderHtml(lnk, save_fn)
    asyncio.ensure_future(rmTmpFile(save_fn), loop=None)
    return l + [Image.fromFileSystem(save_fn)]
Esempio n. 12
0
async def event_gm(app: Mirai, message: MessageChain, group: Group):
    if message.toString().startswith("/image"):
        await app.sendGroupMessage(group, [
            Image.fromFileSystem(
                "E:\\Image\\00C49FCD-D8D9-4966-B2FC-F18F6220485E.jpg"),
            Plain(text="??")
        ])
Esempio n. 13
0
 def __validate_responses__(self, resps):
     valid_resps = []
     for r in resps:
         if r.startswith(self.image_save_path):
             valid_resps.append(Image.fromFileSystem(r))
         else:
             valid_resps.append(Plain(r))
     return valid_resps
Esempio n. 14
0
def 二维码生成器(*attrs, **kwargs):
    s = ' '.join(attrs)
    q = qrcode.make(s)
    fn = randstr(GLOBAL.randomStrLength) + 'tmpqrcode' + str(kwargs['mem'].id)
    q.save(fn)
    #threading.Thread(target=rmTmpFile).start()
    asyncio.ensure_future(rmTmpFile(fn), loop=None)
    return [Image.fromFileSystem(fn)]
Esempio n. 15
0
 async def event_gm(session: Session, message: MessageChain,
                    friend: Friend):
     if message.toString().startswith("/image"):
         await session.sendFriendMessage(friend, [
             Image.fromFileSystem(
                 "E:\\Image\\00C49FCD-D8D9-4966-B2FC-F18F6220485E.jpg"),
             Plain(text="??")
         ])
Esempio n. 16
0
async def put(app: Mirai, group: Group, member: Member, source: Source,
              cp: CommandParser):
    pa = cp.parse_with_valid(["Int", "Int"])
    if isinstance(pa, str):
        return await app.sendGroupMessage(group, [At(member.id), Plain(pa)])
    elif not pa:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("参数不能为空")])
    if member.id not in state:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("你没有加入房间")])
    if room[state[member.id]][0] == member.id:
        if member.id in bind:
            code = bind[state[member.id]].put(pa[0][1], pa[1][1], -1)
        else:
            code = bind[state[member.id]].put(pa[0][1], pa[1][1], 1)
        if code == 1:
            await app.sendGroupMessage(group, [
                At(member.id),
                Plain("胜出\n"),
                Image.fromBytes(bind[state[member.id]].get_image())
            ])
            for m in room[state[member.id]]:
                try:
                    state.pop(m)
                    room.pop(m)
                    bind.pop(m)
                except KeyError:
                    pass
        elif code == 0:
            await app.sendGroupMessage(group, [
                At(room[state[member.id]][1]),
                Plain("轮到你了"),
                Image.fromBytes(bind[state[member.id]].get_image())
            ],
                                       quoteSource=source)
            room[state[member.id]].insert(0, room[state[member.id]].pop(1))
        elif code == -1:
            await app.sendGroupMessage(
                group, [At(member.id), Plain("这里已经有棋子了")])
        elif code == -2:
            await app.sendGroupMessage(group, [At(member.id), Plain("你放过界了")])
    else:
        return await app.sendGroupMessage(
            group, [At(member.id), Plain("还没有轮到你")])
Esempio n. 17
0
async def cget(app: Mirai, group: Group, member: Member):
    if member.id in room[state[member.id]]:
        await app.sendGroupMessage(group, [
            At(member.id),
            Image.fromBytes(bind[state[member.id]].get_image(
                quality=random.randint(90, 99)))
        ])
    else:
        await app.sendGroupMessage(group, [At(member.id), Plain("未找到你所处的房间")])
Esempio n. 18
0
def local_contents2message_chain(contents):
    msg = []
    for item in contents:
        for typ, cont in item.items():
            if typ == "Plain":
                msg.append(Plain(text=cont))
            elif typ == "Image":
                msg.append(Image.fromBase64(cont))
    return msg
Esempio n. 19
0
def 爬LaTeX(*attrs, **kwargs):
    base = r'\dpi{150} \bg_white \large ' + ' '.join(attrs).replace(
        '+', '&plus;')
    r = requests.get(
        'https://latex.vimsky.com/test.image.latex.php?fmt=png&dl=0&val=' +
        urllib.parse.quote(urllib.parse.quote(base)))
    fn = f"tmpLaTeX{randstr(3)}.png"
    with open(fn, 'wb') as f:
        f.write(r.content)
    asyncio.ensure_future(rmTmpFile(fn))
    return [Image.fromFileSystem(fn)]
Esempio n. 20
0
def IPlay生成器(*attrs,**kwargs):
    font = ImageFont.truetype('sarasa-gothic-ttf-0.12.5/sarasa-ui-tc-bold.ttf',25)
    Src = PImage.open('IPlayRhythmGame.png').convert('RGBA')
    layer2 = PImage.new('RGBA',Src.size,(255,255,255,0))
    draw = ImageDraw.Draw(layer2)
    
    text = ' '.join(attrs)
    beginPixel = (308,1004)

    draw.text(beginPixel,text,fill=(255,255,255,255),font=font)
    p = 'tmpIPlay' + randstr(GLOBAL.randomStrLength) +str(kwargs['mem'].id)+'.png'

    PImage.alpha_composite(Src,layer2).save(p)
    asyncio.ensure_future(rmTmpFile(p))
    return [Image.fromFileSystem(p)]
Esempio n. 21
0
def 优质解答生成器(*attrs,**kwargs):
    font = ImageFont.truetype('sarasa-gothic-ttf-0.12.5/sarasa-ui-tc-bold.ttf',25)
    nyaSrc = PImage.open('answer.jpg').convert('RGBA')
    layer2 = PImage.new('RGBA',nyaSrc.size,(255,255,255,0))
    draw = ImageDraw.Draw(layer2)
    
    text = ' '.join(attrs)
    beginPixel = (50,120)

    draw.text(beginPixel,text,fill=(0,0,0,255),font=font)
    p = 'tmpAns' + randstr(GLOBAL.randomStrLength) +str(kwargs['mem'].id)+'.png'

    PImage.alpha_composite(nyaSrc,layer2).save(p)
    asyncio.ensure_future(rmTmpFile(p),loop=None)
    return [Image.fromFileSystem(p)]
Esempio n. 22
0
def showClock(sender):
    clockMessage=[
        At(target=sender),
        Plain(text="看中后直接发送选择表盘+序号即可哦~\n"),
        Plain(text="如:选择表盘1\n"),
        Plain(text="表盘预览:")
    ]
    clockList = os.listdir(clockPreviewDist)
    clockList.sort(key=lambda x:int(x[:-4]))
    index=1
    for i in clockList:
        clockMessage.append(Plain(text="\n%s."%index))
        clockMessage.append(Image.fromFileSystem(clockPreviewDist+i))
        index+=1
    return clockMessage
Esempio n. 23
0
 async def send(prefix_: str, data_: SetuData):
     try:
         setu_b: bytes = await data_.get()
         await app.sendGroupMessage(group, [
             At(sender.id),
             Plain(prefix_ + data_.purl + '\n'),
             Image.fromBytes(setu_b)
         ])
         EventLogger.info(f"{prefix_}色图已发送,标签:{','.join(data_.tags)}")
     except asyncio.TimeoutError as e:
         EventLogger.warn('连接超时' + str(e))
         raise e
     except ValueError as e:
         EventLogger.warn('图片尺寸检查失败' + str(e))
         raise e
Esempio n. 24
0
def rsshub_weibo_html2list(htmltext):
    htmltext=htmltext.replace("<br />","<br/>").replace("<br/><br/>","<br/>").replace("<br><br>","<br>")
    tree=html.fromstring(htmltext)
    lis=tree.xpath("node()")
    # res_lis=[]
    msg_lis=[]
    for x in lis:
        if isinstance(x,str):
            msg_lis.append(Plain(text=x))
        else:
            if x.tag=="a":
                msg_lis.append(Plain(text="".join(x.xpath(".//text()"))))
                if x.xpath("./img"):
                    img=x.xpath("./img")[0]
                    bytes_image=get_bytes_image_from_url(img.xpath("./@src")[0])
                    msg_lis.append(Image.fromBytes(bytes_image))
            if x.tag=="br":
                msg_lis.append(Plain(text="\n"))
            if x.tag=="img":
                bytes_image=get_bytes_image_from_url(x.xpath("./@src")[0])
                msg_lis.append(Image.fromBytes(bytes_image))

    # print(res_lis)
    return msg_lis
Esempio n. 25
0
async def quote(app: Mirai, group: Group, message: MessageChain,
                member: Member, source: Source):
    if message.toString().find("骂我") != -1:
        txt1 = requests.get(url1)
        await app.sendGroupMessage(
            group, [At(member.id), Plain(text=txt1.text)], quoteSource=source)
        return True
    if message.toString().find("夸我") != -1:
        txt2 = requests.get(url2)
        await app.sendGroupMessage(
            group, [At(member.id), Plain(text=txt2.text)], quoteSource=source)
        return True
    if message.toString().find("tu") != -1:
        pic = picbase()
        print(pic)
        await app.sendGroupMessage(group, [Image.fromBase64(pic)])
        return True
Esempio n. 26
0
    def format_enemy_info(self, name):
        res = [name]
        url = self.enemy_data[name]["link"]
        res.append(url)
        res_text = "\n".join(res)

        # r=requests.get(self.enemy_data[name]["head_pic"],timeout=30)
        # buffer=r.content
        bytes_image = get_bytes_image_from_url(
            self.enemy_data[name]["head_pic"])

        ret_msg = [
            Image.fromBytes(bytes_image),
            Plain(text="\n"),
            Plain(text=res_text)
        ]

        return ret_msg
Esempio n. 27
0
async def mrfz_cake():
    now = datetime.now(pytz.timezone('Asia/Shanghai'))
    timetext = now.strftime('%H:%M:%S')

    url = "https://z3.ax1x.com/2021/04/26/gSEHd1.jpg"
    r = requests.get(url, timeout=30)
    buffer = r.content

    msg = [Image.fromBytes(buffer)]

    group_id_list = myconfig.group_mrfz_cake_id_list

    try:
        for group_id in group_id_list:
            await app.sendGroupMessage(group_id, msg)
            # await app.sendGroupMessage(group_id, [Plain(text=f'现在时间 {timetext}')])

    except Exception as e:
        print(e)
Esempio n. 28
0
    def to_message_list(self):
        ret = []
        for each_component in self.message:
            if each_component['type'] == 'Plain':
                ret.append(Plain(text=each_component['text']))
            elif each_component['type'] == 'At':
                ret.append(At(target=each_component['target']))
            elif each_component['type'] == 'AtAll':
                ret.append(AtAll())
            elif each_component['type'] == 'Image':
                ret.append(Image(imageId=each_component['imageId']))
            elif each_component['type'] == 'Face':
                ret.append(Face(faceId=each_component['faceId']))
            elif each_component['type'] == 'Xml':
                ret.append(Xml(XML=each_component['xml']))
            elif each_component['type'] == 'Json':
                ret.append(Json(Json=each_component['json']))

        return ret
Esempio n. 29
0
def 希望工程(*attrs,**kwargs):
    font = ImageFont.truetype('sarasa-gothic-ttf-0.12.5/sarasa-ui-tc-bold.ttf',100)
    nyaSrc = PImage.open('wish.jpg').convert('RGBA')
    layer2 = PImage.new('RGBA',nyaSrc.size,(255,255,255,0))
    draw = ImageDraw.Draw(layer2)
    
    text = attrs[0]
    beginPixel = (540-len(text)*50,900)
    if len(attrs)>1:
        r = int(attrs[1][:2],16)
        g = int(attrs[1][2:4],16)
        b = int(attrs[1][4:],16)
        draw.text(beginPixel,text,fill=(r,g,b,255),font=font)
    else:
        draw.text(beginPixel,text,fill=(0,0,0,255),font=font)
    p = 'tmpWish' + randstr(GLOBAL.randomStrLength) + str(kwargs['mem'].id)+'.png'

    PImage.alpha_composite(nyaSrc,layer2).save(p)
    asyncio.ensure_future(rmTmpFile(p),loop=None)
    return [Image.fromFileSystem(p)]
Esempio n. 30
0
    def get_response(self):
        if self.__handle_at_all__():
            return self.responses

        if not self.command.chat_mode:
            bot = config['mirai_http_api']['qq']
            if bot not in (at.target for at in self.ats):
                return self.responses

        if self.__handle_plain_text__():
            return self.responses

        self.__handle_face__()
        self.__handle_image__()

        if not self.responses:
            rand_img = image_helper.get_rand_img(
                config['image']['not_understand'])
            return [Image.fromFileSystem(rand_img)]

        return self.responses