Exemple #1
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    args = stripped_arg.split()  # split()函数默认可以按空格分割,并且把结果中的空字符串删除掉,留下有用信息
    if len(args) != 3:
        session.state['format'] = False
        return
    else:
        # args长度位3
        number = args[2]
        pro_name = args[1]
        qq = args[0]
        qq = search_qq_alias(qq)
        if not is_number(number):
            # 不是数字
            session.state['format'] = False
            return
        elif not is_number(qq):
            # 不是qq
            session.state['format'] = False
            return
        else:
            [result, index, name] = search_name_in_settings(pro_name)
            if not result:
                # 属性名错误
                session.state['format'] = False
                return
                # 格式正确
        session.state['format'] = True
        session.state['change_qq'] = qq
        session.state['change_number'] = number
        session.state['pro_name'] = name
        session.state['pro_index'] = index
        return
Exemple #2
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    args = stripped_arg.split()  # split()函数默认可以按空格分割,并且把结果中的空字符串删除掉,留下有用信息
    if len(args) != 3:
        session.state['format'] = False
        return
    else:
        # args长度位3
        debuff_name = args[2]
        op_type = args[1]
        qq = args[0]
        qq = search_qq_alias(qq)
        if not is_number(qq):
            # 不是数字
            session.state['format'] = False
            return
        if op_type != '+' and op_type != '-':
            # 不是操作符
            session.state['format'] = False
            return
        # buff_name的操作暂略
        # pass
        session.state['format'] = True
        session.state['change_qq'] = qq
        session.state['op_type'] = op_type
        session.state['debuff_name'] = debuff_name
        return
Exemple #3
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    args = stripped_arg.split()  # split()函数默认可以按空格分割,并且把结果中的空字符串删除掉,留下有用信息
    if len(args) != 2:
        session.state['format'] = False
        return
    else:
        # args长度位2
        number = args[1]
        qq = args[0]
        qq = search_qq_alias(qq)
        if not is_number(number):
            # 不是数字
            session.state['format'] = False
            return
        elif not is_number(qq):
            # 不是qq
            session.state['format'] = False
            return
        # 格式正确
        session.state['format'] = True
        session.state['change_qq'] = qq
        session.state['change_number'] = number
        return
Exemple #4
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    arg = stripped_arg.split()  # split()函数默认可以按空格分割,并且把结果中的空字符串删除掉,留下有用信息
    if len(arg) != 1:
        session.state['format'] = False
        return
    elif not is_number(search_qq_alias(arg[0])):
        session.state['format'] = False
        return
    else:
        # arg长度位1
        qq = arg[0]
        qq = search_qq_alias(qq)
        # 格式正确
        session.state['format'] = True
        session.state['change_qq'] = qq