async def _(session: CommandSession): ctx_id = context_id(session.event) stripped_arg = session.current_arg_text.strip() key_str,value_str = stripped_arg.split("=") mvl = Load_Reply.value_max_len(ctx_id) mkl = Load_Reply.key_max_len(ctx_id) if len(value_str)>mvl or len(key_str)>mkl: if len(value_str)>mvl: await session.send(f"‘{value_str}’作为value过长,目前最大长度为{mvl}个字") if len(key_str)>mkl: await session.send(f"‘{key_str}’作为key过长,目前最大长度为{mkl}个字") else: Load_Reply.add_key(ctx_id = ctx_id,key_str = key_str,value_str = value_str) await session.send(f"已添加私有关键词{key_str}=>{value_str}")
async def _(session: CommandSession): stripped_arg = session.current_arg_text.strip() key_str,value_str = stripped_arg.split("=") Load_Reply.add_key(key_str = key_str,value_str = value_str) await session.send(f"已添加共有关键词{key_str}=>{value_str}")