fix help spacing, add clear

This commit is contained in:
Cynthia Foxwell 2022-08-27 21:40:53 -06:00
parent daeed08a6a
commit 080d20396b
2 changed files with 24 additions and 6 deletions

View file

@ -33,6 +33,11 @@ You **MUST** grant your bot all Privileged Gateway Intents.
- [ ] Creation date, join date, ID, etc
- [x] Room history (r)
- [x] Extended room history (R)
- [ ] List channels (l)
- [x] List guilds (L)
- [x] Clear (c)
- [ ] Surf channels forwards (>)
- [ ] Surf channels backwards (<)
- [x] Message Receiving
- [ ] Markdown styling
- [ ] Common markdown (bold, italic, etc)

View file

@ -30,9 +30,11 @@ const commands = {
w: "who is in guild",
f: "finger",
r: "channel history",
R: "extended channel history",
R: "extended history",
h: "command help",
c: "clear",
"<": "surf backwards",
">": "surf forwards",
};
const client = new Eris("Bot " + token, {
@ -262,17 +264,18 @@ function showHelp() {
console.log("\nCOMcord (c)left 2022\n");
const keys = Object.keys(commands);
keys.sort();
keys.sort((a, b) => a.localeCompare(b));
let index = 0;
for (const key of keys) {
const desc = commands[key];
const length = ` ${key} - ${desc}`.length;
stdout.write(
(" " + chalk.bold.yellow(key) + chalk.reset(" - " + desc)).padEnd(
25,
" "
)
" " +
chalk.bold.yellow(key) +
chalk.reset(" - " + desc) +
" ".repeat(Math.abs(25 - length))
);
index++;
@ -702,6 +705,16 @@ stdin.on("data", function (key) {
startExtendedHistory();
break;
}
case "c": {
console.clear();
break;
}
case "<": {
break;
}
case ">": {
break;
}
case " ":
case "\r":
default: {