Exemplo n.º 1
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['key_words'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('关键字不能为空呢,请重新输入')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 2
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['CQcode'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('要回响的内容称不能为空呢,请重新输入')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 3
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['aud'] = stripped_arg.split()[0]
        return

    if not stripped_arg:
        session.pause('好吗')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 4
0
async def _(session: CommandSession):
    image_arg = session.current_arg_images

    if session.is_first_run:
        if image_arg:
            session.state['image'] = image_arg[0]
        return

    if not image_arg:
        session.pause('没图说个J*,GKD!')

    session.state[session.current_key] = image_arg
Exemplo n.º 5
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['sub_tips'] = str(stripped_arg)
        return

    if not stripped_arg:
        session.pause('请输入要提交的tips')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 6
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['key_word'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('没时间等了!快说你要去哪里?')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 7
0
def _(session: CommandSession):
    if session.current_arg_images:
        session.switch(f"!{GET_IMAGE_METHOD} {session.current_arg}")
    strippedArgs = session.current_arg_text.strip()
    if not strippedArgs:
        session.pause("请输入搜索关键词")
    keywords: List[str] = strippedArgs.split(" ")
    if len(keywords) >= 2:
        if keywords[0].isdigit():
            session.state["page"] = int(keywords[0])
            keywords.pop(0)
    session.state["keyword"] = " ".join(keywords)
Exemplo n.º 8
0
async def _(session: CommandSession):
    arg = session.current_arg

    if session.is_first_run:
        if arg:
            session.state['command'] = arg
        return

    if not arg:
        session.pause('描述不能为空呢,请重新输入')

    session.state[session.current_key] = arg
Exemplo n.º 9
0
async def _(session: CommandSession):
	stripped_arg = session.current_arg_text.strip() #去除信息首尾空白符
	
	if session.is_first_run:
		if stripped_arg:
			session.state['text'] = stripped_arg
		return
	
	if not stripped_arg:
		session.pause('你输了个啥???')
	
	session.state[session.current_key] = stripped_arg
Exemplo n.º 10
0
async def _(session: CommandSession):
    arg = session.current_arg

    if session.is_first_run:
        if arg:
            session.state['info'] = arg
        return

    if not arg:
        session.pause('管理员让我给宁带个话:宁搁这儿虚空致电呢?GKD把信息给我!')

    session.state[session.current_key] = arg
Exemplo n.º 11
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['word'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('小心我把你全家都埋咯!')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 12
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['Test_Query_Overview'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('要查询的ID不能为空,请重新输入')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 13
0
async def _(session: nonebot.CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['query_word'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('输入为空,请重新输入')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 14
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['city'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('要查询的城市名称不能为空呢,请重新输入!')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 15
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        if stripped_arg:
            session.state['repeat_string'] = stripped_arg
        return

    if not stripped_arg:

        session.pause('!!!!!!!!!!')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 16
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()
    url = get_url(stripped_arg)

    if session.is_first_run:
        if url:
            session.state['url'] = url
        return

    if not url:
        session.pause('宁就是虚空带师?关键词GKD!')

    session.state[session.current_key] = url
Exemplo n.º 17
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        # 该命令第一次运行(第一次进入命令会话)
        if stripped_arg:
            session.state['type'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('国创or番剧?')
    session.state[session.current_key] = stripped_arg
Exemplo n.º 18
0
async def _(session: CommandSession):
    arg = session.current_arg_text.strip()

    if session.is_first_run:
        # 所输入队伍信息不为空且符合队伍格式
        if arg and team_check(arg):
            session.state['team_info'] = arg
        return

    # 填写的阵容名单为空或不符合队伍格式
    if (not arg) or (not team_check(arg)):
        session.pause('填写的阵容名单为空或不符合规格,请重新填写!')
    session.state[session.current_key] = arg
Exemplo n.º 19
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg.strip()
    
    print(stripped_arg)
    if session.is_first_run:
        if stripped_arg:
            session.state['img_src'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('请重新提供图片')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 20
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        # 该命令第一次运行(第一次进入命令会话)
        if stripped_arg:
            session.state['sentence'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('要说的话不能为空呢,请重新输入')
    session.state[session.current_key] = stripped_arg
Exemplo n.º 21
0
async def _(session: CommandSession):
    arg = session.current_arg.strip()

    if session.is_first_run:
        if not arg:
            return

        session.state['keyword'] = arg

    if not arg:
        session.pause('请输入关键词')

    session.state[session.current_key] = arg
Exemplo n.º 22
0
async def _(session: CommandSession):
    # 去掉首尾的空白
    current_arg = session.current_arg.strip()
    stripped_arg = current_arg.split()

    if session.is_first_run:
        if stripped_arg:
            session.state['question'] = stripped_arg
        return

    if not stripped_arg:
        session.pause("未收到问题,请重新输入 (提问 xxxx)")
    session.state[session.current_key] = stripped_arg
Exemplo n.º 23
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白字符
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:  # 第一次开启会话,判断是不是自带故事参数
        session.state['isLoad'] = False  # 插个旗子,isLoad判断是不是已经输入过故事名
        if stripped_arg:
            session.state['story_name'] = stripped_arg
        return

    if not session.state['isLoad'] and not stripped_arg:  # 如果输入空白字符
        session.pause("故事名不能为空呢,请选择故事")
    return
Exemplo n.º 24
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    if session.is_first_run:
        # 该命令第一次运行(第一次进入命令会话)
        if stripped_arg:
            # 第一次运行参数不为空,意味着用户直接将参数名跟在命令名后面,作为参数传入
            session.state['share_data'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('你想对什么垃圾进行分类呢~')
    session.state[session.current_key] = stripped_arg
Exemplo n.º 25
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()
    # 第一次运行
    if session.is_first_run:
        if stripped_arg == '-c':
            session.state['checked'] = True
        if stripped_arg:
            session.state['content'] = stripped_arg
        return

    if not stripped_arg:
        session.pause('请输入')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 26
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run:
        # 该命令第一次运行(第一次进入命令会话)
        if stripped_arg:
            session.state['args'] = stripped_arg
            return

    if not stripped_arg:
        pass
        session.pause("input args")

    session.state[session.current_key] = stripped_arg
Exemplo n.º 27
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip().split('\r')[0]

    if session.is_first_run:
        if stripped_arg:
            session.state['title'] = stripped_arg
        else:
            session.state['title'] = await sentence(random.randint(1, 5))
        return

    if not stripped_arg:
        session.pause('ERR')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 28
0
async def _(session: CommandSession):
    stripped_arg = session.current_arg_text.strip()

    if session.is_first_run and stripped_arg:
        session.state['code'] = stripped_arg
        return

    if not session.current_key:
        return

    if not stripped_arg:
        session.pause('请发送正确的内容哦')

    session.state[session.current_key] = stripped_arg
Exemplo n.º 29
0
async def _(session: CommandSession):
    arg = session.current_arg_text.strip()

    if session.is_first_run:

        if arg:
            session.state['damage'] = arg
        return

    if (not arg):
        session.pause('填写的伤害为空请重新填写!')

    # 若当前正在询问更多信息,且新输入的信息有效,则放入会话状态
    session.state[session.current_key] = arg
Exemplo n.º 30
0
async def _(session: CommandSession):
    # 去掉消息首尾的空白符
    stripped_arg = session.current_arg_text.strip()
    if session.is_first_run:
        # 该命令第一次运行(第一次进入命令会话)
        if stripped_arg:
            session.state['banned_time'] = stripped_arg
        return

    if not stripped_arg:
        # 这里 session.pause() 将会发送消息并暂停当前会话(该行后面的代码不会被运行)
        session.pause('请重新输入')

    session.state[session.current_key] = stripped_arg