This commit is contained in:
19
plugins/cook/utils/index.js
Normal file
19
plugins/cook/utils/index.js
Normal file
@ -0,0 +1,19 @@
|
||||
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.shift(header);
|
||||
}
|
||||
|
||||
if (footer) {
|
||||
textList.push(footer);
|
||||
}
|
||||
|
||||
return textList.join('\n----------\n');
|
||||
}
|
Reference in New Issue
Block a user