Files
mol-robot/plugins/cook/utils/index.js
mol 164b6fa28e
Some checks are pending
continuous-integration/drone/push Build is running
test
2023-12-14 13:48:52 +08:00

20 lines
432 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');
}