Пример #1
0
async def _(session: NLPSession):
    if check_blacklist(session.ctx.get('user_id')
                       ) or session.msg.strip()[0] == ".":
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    if session.ctx.get('group_id') == 【数据删除】:
        return None
    if not check_whitelist(session.event.group_id):
        return None
    result = NLPResult(85.0, 'Zhangyuwang', {'message': session.msg})
    return result
Пример #2
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    split_flag = False
    if session.ctx.get('group_id') is None:
        split_flag = True
    # split_flag = False
    split_flag = True
    arg = session.current_arg_text.strip().lower()
    if not arg:
        arg = session.get('arg', prompt='请输入查询内容')
    mylist = get_by_id(arg)
    if mylist:
        if split_flag:
            listToSend = split_array(mylist)
            for myArray in listToSend:
                await session.send("\n".join(
                    (i[0] + " " + i[1] + " " + i[2] + " " + i[3] + " " + i[4] +
                     " " + i[5]) for i in myArray))
        else:
            await session.send("\n".join((i[0] + " " + i[1] + " " + i[2] +
                                          " " + i[3] + " " + i[4] + " " + i[5])
                                         for i in mylist))
    else:
        await session.send("本次查询无结果")
    return
Пример #3
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    split_flag = False
    if session.ctx.get('group_id') is None:
        split_flag = True
    # split_flag = False
    # split_flag = True
    arg = session.current_arg_text.strip().lower()
    if not arg:
        arg = session.get('arg', prompt='请输入查询内容')
    mylist = get_by_name(arg)
    if mylist:
        if split_flag:
            listToSend = split_array(mylist)
            for myArray in listToSend:
                await session.send("\n".join(
                    (i[0] + " " + i[1] + " " + i[2] + " " + i[3] + " " + i[4] +
                     " " + i[5]) for i in myArray))
        else:
            await session.send("\n".join((i[0] + " " + i[1] + " " + i[2] +
                                          " " + i[3] + " " + i[4] + " " + i[5])
                                         for i in mylist))
    else:
        if arg.encode('UTF-8').isalnum() == False and len(arg) > 2:
            mylist = get_by_name_fuzzy(arg)
            if mylist and len(mylist) <= 10:
                await session.send("本次查询无结果。但你是否在找:\n" + "\n".join(
                    (i[0] + " " + i[1] + " " + i[2] + " " + i[3] + " " + i[4] +
                     " " + i[5]) for i in mylist))
                return
        await session.send("本次查询无结果")
    return
Пример #4
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    mybot = session.bot
    NationalAwardTuple = (【数据删除】, 【数据删除】, 【数据删除】, 【数据删除】, 【数据删除】)
    if session.ctx.get('user_id') in NationalAwardTuple:
        tmp_info = await mybot.get_group_member_info(group_id=【数据删除】, user_id=session.ctx.get('user_id'), no_cache=True)
    else:
        random.seed()
        chosen_id = NationalAwardTuple[int(
            random.uniform(0, len(NationalAwardTuple) - 0.001))]
        tmp_info = await mybot.get_group_member_info(group_id=【数据删除】, user_id=chosen_id, no_cache=True)
    MyText = session.state.get('message').strip()
    Mylist = ["国奖人"]
    for keyword in Mylist:
        if MyText.find(keyword) != -1:
            answer = MyText.find(keyword)
            text0 = MyText[0:answer]
            if text0 != "":
                text0 = text0 + " "
            text1 = MyText[(answer + len(keyword)):]
            if text1 != "":
                text1 = " " + text1
            await session.send(text0 + "@" + tmp_info["nickname"] + text1)
            return None
    return None
Пример #5
0
async def _(session: NLPSession):
    if check_blacklist(session.ctx.get('user_id')
                       ) or session.msg.strip()[0] == ".":
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    result = NLPResult(70.0, 'DoNothing', {'message': session.msg})
    return result
Пример #6
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    else:
        await session.send(
            "命令已弃用。当前可用命令为 1)查询本科/查询硕博/查询教师,可以相应范围内精确查找姓名,学(工)号或拼音首字母。2)查询姓名/查询学号,可以在全部范围内精确查找姓名/学(工)号。"
        )
    return
Пример #7
0
async def _(session: NLPSession):
    if check_blacklist(session.ctx.get('user_id')
                       ) or session.msg.strip()[0] == ".":
        return None
    if session.ctx.get('group_id') == 【数据删除】:
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    result = NLPResult(75.0, 'TheStrongOne', {'message': session.msg})
    return result
Пример #8
0
async def shenwei(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    if session.ctx.get('group_id') == 【数据删除】:
        return None
    arg = session.current_arg_text.strip().lower()
    if arg == "阴":
        profile = get_yinyang_list(mode='yin').strip().split("\n")
    elif arg == "阳":
        profile = get_yinyang_list(mode='yang').strip().split("\n")
    else:
        profile = get_yinyang_list().strip().split("\n")
    for text in profile:
        await session.send(text)
Пример #9
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    plugins = list(filter(lambda p: p.name, nonebot.get_loaded_plugins()))
    arg = session.current_arg_text.strip().lower()
    if not check_whitelist(session.ctx.get('group_id')):
        temp_plugins = ["离散对数", "抽象话", "知乎热榜", "打断复读", "素性测试"]
        await session.send('我现在支持的功能有:\n' +
                           '\n'.join(p for p in temp_plugins) + '\n\n' +
                           '另外,此bot还缝合了跑团掷骰功能。请输入.dicehelp以查看该功能的使用说明。')
        return
    if not arg:
        await session.send('我现在支持的功能有:\n' + '\n'.join(p.name
                                                      for p in plugins) +
                           '\n\n' + '输入help [功能名] 可以查看具体使用方法。\n' +
                           '另外,此bot还缝合了跑团掷骰功能。请输入.dicehelp以查看该功能的使用说明。')
        return
    for p in plugins:
        if p.name.lower() == arg:
            await session.send(p.usage)
Пример #10
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    mybot = session.bot
    tmp_info = await mybot.get_group_member_info(group_id=【数据删除】, user_id=【数据删除】, no_cache=True)
    MyText = session.state.get('message').strip()
    Mylist = ["强者", "全栈人"]
    for keyword in Mylist:
        if MyText.find(keyword) != -1:
            answer = MyText.find(keyword)
            text0 = MyText[0:answer]
            if text0 != "":
                text0 = text0 + " "
            text1 = MyText[(answer + len(keyword)):]
            if text1 != "":
                text1 = " " + text1
            await session.send(text0 + "@" + tmp_info["nickname"] + text1)
            return None
    return None
Пример #11
0
async def _(session: CommandSession):
    if check_blacklist(session.ctx.get('user_id')):
        return None
    if not check_whitelist(session.ctx.get('group_id')):
        return None
    split_flag = False
    if session.ctx.get('group_id') is None:
        split_flag = True
    # split_flag = False
    # split_flag = True
    arg = session.current_arg_text.strip().lower()
    if not arg:
        arg = session.get('arg', prompt='请输入查询内容')
    mylist = get_teacher(arg)
    if mylist:
        base_str_list = []
        for i in mylist:
            base_str = i[0] + " " + i[1] + " " + i[2] + " " + i[3] + " " + i[5]
            if i[6]:
                base_str += "\n" + "办公电话:" + i[6]
            if i[7]:
                base_str += "\n" + "手机:" + i[7]
            if i[8]:
                base_str += "\n" + "邮箱:" + i[8]
            if i[9]:
                base_str += "\n" + "简介:" + i[9]
            base_str_list.append(base_str)
        await session.send("\n".join(k for k in base_str_list))
    else:
        if arg.encode('UTF-8').isalnum() == False:
            mylist = get_by_name(arg)
            if mylist:
                await session.send("本次查询无结果。但你是否在找:\n" + "\n".join(
                    (i[0] + " " + i[1] + " " + i[2] + " " + i[3] + " " + i[4] +
                     " " + i[5]) for i in mylist))
                return
        await session.send("本次查询无结果")
    return