mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-23 06:32:06 +02:00
16 lines
785 B
JavaScript
16 lines
785 B
JavaScript
import * as skills from './skills.js';
|
|
|
|
export function getSkillDocs() {
|
|
let docstring = "\n*SKILL DOCS\nThese skills are javascript functions that can be called with a js function by writing a code block. Ex: '```// write description comment and code here```' \n\
|
|
Your code block should return a bool indicating if the task was completed successfully. It will return true if you don't write a return statement.\n";
|
|
for (let skillFunc of Object.values(skills)) {
|
|
let str = skillFunc.toString();
|
|
docstring += skillFunc.name;
|
|
docstring += str.substring(str.indexOf('/**')+3, str.indexOf('**/')) + '\n';
|
|
}
|
|
return docstring + '*\n';
|
|
}
|
|
|
|
export function containsCodeBlock(message) {
|
|
return message.indexOf('```') !== -1;
|
|
}
|