Files
mol-robot/plugins/cook/utils/index.js
mol 0ce94d8cba
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
test
2023-12-14 15:05:30 +08:00

22 lines
549 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pkg from 'mirai-js'
const { Message } = pkg
export function genRecipeMessage(recipeList, header, footer) {
const msg = new Message()
if (header) {
msg.addText(`${header}\n\n`);
}
recipeList.forEach((recipe, index)=> {
msg.addText(`${index + 1}. ${recipe.name}\n`)
msg.addText(`\t· 材料:${recipe.stuff}\n`)
msg.addText(`\t· 厨具:${recipe.tools}\n`)
msg.addText(`\t· 制作视频https://www.bilibili.com/video/${recipe.bv}\n\n`)
})
if (footer) {
msg.addText(`${footer}`);
}
return msg
}