Combining commands

This commit is contained in:
Dan 2025-12-31 13:26:33 +00:00
parent 1a18f56927
commit 99215afe55

View file

@ -83,8 +83,8 @@ if (window.terminal) {
// ADD YOUR OWN COMMANDS BELOW THIS LINE
// ========================================
// Hidden WOW command (no description = won't show in help)
window.terminal.registerCommand("wow", "", () => {
// Shared function for wow/puppies commands
const playWowCommand = () => {
const audio = new Audio("/audio/wow.mp3");
audio.play().catch((error) => {
window.terminal.printError("Failed to play audio: " + error.message);
@ -108,11 +108,17 @@ if (window.terminal) {
`;
window.terminal.print(art, "success");
});
};
// Hidden WOW command (no description = won't show in help)
window.terminal.registerCommand("wow", "", playWowCommand);
// Hidden puppies command (no description = won't show in help)
window.terminal.registerCommand("puppies", "", playWowCommand);
// Template for new command:
/*