Skip to content

Commit bfc5f58

Browse files
committed
Add cowsay command
1 parent cf35791 commit bfc5f58

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

config/commands.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,24 @@ const commands = {
159159
term.stylePrint(`(Robot voice): ${message}`);
160160
},
161161

162+
cowsay: function (args) {
163+
const message = args.join(" ") || "moo";
164+
const msgLen = message.length;
165+
const top = " " + "_".repeat(msgLen + 2);
166+
const bottom = " " + "-".repeat(msgLen + 2);
167+
const cow = [
168+
`< ${message} >`,
169+
bottom,
170+
" \\ ^__^",
171+
" \\ (oo)\\_______",
172+
" (__)\\ )\\/\\",
173+
" ||----w |",
174+
" || ||",
175+
];
176+
term.writeln(top);
177+
cow.forEach((line) => term.writeln(line));
178+
},
179+
162180
pwd: function () {
163181
term.stylePrint("/" + term.cwd.replaceAll("~", `home/${term.user}`));
164182
},

0 commit comments

Comments
 (0)