Update actions.js

Adding the !help command to instruct the bot to display all configured commands and their descriptions. Lightly formatted.
This commit is contained in:
HackDefendr 2024-11-19 17:37:32 -06:00 committed by GitHub
parent 29c6654dbb
commit c6926f5481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -374,4 +374,16 @@ export const actionsList = [
// return 'Set npc goal: ' + agent.npc.data.curr_goal.name;
// }
// },
{
name: '!help',
description: 'Lists all available commands and their descriptions.',
perform: async function (agent) {
const commandList = actionsList.map(action => {
return `${action.name.padEnd(15)} - ${action.description}`; // Ensure consistent spacing
}).join('\n');
console.log(commandList);
return `Available Commands:\n${commandList}`;
}
},
];