20 lines
435 B
JavaScript
20 lines
435 B
JavaScript
export function genRecipeMessage(recipeList, header, footer) {
|
|
const textList = [];
|
|
|
|
for (let recipe of recipeList) {
|
|
textList.push(
|
|
`吃${recipe['name']}\n准备材料:${recipe.stuff}\n使用厨具:${recipe.tools}\nhttps://www.bilibili.com/video/${recipe.bv}`,
|
|
);
|
|
}
|
|
|
|
if (header) {
|
|
textList.unshift(header);
|
|
}
|
|
|
|
if (footer) {
|
|
textList.push(footer);
|
|
}
|
|
|
|
return textList.join('\n----------\n');
|
|
}
|