fix help spacing, add clear
This commit is contained in:
		
							parent
							
								
									daeed08a6a
								
							
						
					
					
						commit
						080d20396b
					
				
					 2 changed files with 24 additions and 6 deletions
				
			
		| 
						 | 
					@ -33,6 +33,11 @@ You **MUST** grant your bot all Privileged Gateway Intents.
 | 
				
			||||||
    - [ ] Creation date, join date, ID, etc
 | 
					    - [ ] Creation date, join date, ID, etc
 | 
				
			||||||
  - [x] Room history (r)
 | 
					  - [x] Room history (r)
 | 
				
			||||||
  - [x] Extended 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
 | 
					- [x] Message Receiving
 | 
				
			||||||
  - [ ] Markdown styling
 | 
					  - [ ] Markdown styling
 | 
				
			||||||
    - [ ] Common markdown (bold, italic, etc)
 | 
					    - [ ] Common markdown (bold, italic, etc)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										25
									
								
								src/index.js
									
										
									
									
									
								
							
							
						
						
									
										25
									
								
								src/index.js
									
										
									
									
									
								
							| 
						 | 
					@ -30,9 +30,11 @@ const commands = {
 | 
				
			||||||
  w: "who is in guild",
 | 
					  w: "who is in guild",
 | 
				
			||||||
  f: "finger",
 | 
					  f: "finger",
 | 
				
			||||||
  r: "channel history",
 | 
					  r: "channel history",
 | 
				
			||||||
  R: "extended channel history",
 | 
					  R: "extended history",
 | 
				
			||||||
  h: "command help",
 | 
					  h: "command help",
 | 
				
			||||||
  c: "clear",
 | 
					  c: "clear",
 | 
				
			||||||
 | 
					  "<": "surf backwards",
 | 
				
			||||||
 | 
					  ">": "surf forwards",
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const client = new Eris("Bot " + token, {
 | 
					const client = new Eris("Bot " + token, {
 | 
				
			||||||
| 
						 | 
					@ -262,17 +264,18 @@ function showHelp() {
 | 
				
			||||||
  console.log("\nCOMcord (c)left 2022\n");
 | 
					  console.log("\nCOMcord (c)left 2022\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const keys = Object.keys(commands);
 | 
					  const keys = Object.keys(commands);
 | 
				
			||||||
  keys.sort();
 | 
					  keys.sort((a, b) => a.localeCompare(b));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  let index = 0;
 | 
					  let index = 0;
 | 
				
			||||||
  for (const key of keys) {
 | 
					  for (const key of keys) {
 | 
				
			||||||
    const desc = commands[key];
 | 
					    const desc = commands[key];
 | 
				
			||||||
 | 
					    const length = `  ${key} - ${desc}`.length;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    stdout.write(
 | 
					    stdout.write(
 | 
				
			||||||
      ("  " + chalk.bold.yellow(key) + chalk.reset(" - " + desc)).padEnd(
 | 
					      "  " +
 | 
				
			||||||
        25,
 | 
					        chalk.bold.yellow(key) +
 | 
				
			||||||
        " "
 | 
					        chalk.reset(" - " + desc) +
 | 
				
			||||||
      )
 | 
					        " ".repeat(Math.abs(25 - length))
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    index++;
 | 
					    index++;
 | 
				
			||||||
| 
						 | 
					@ -702,6 +705,16 @@ stdin.on("data", function (key) {
 | 
				
			||||||
        startExtendedHistory();
 | 
					        startExtendedHistory();
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      case "c": {
 | 
				
			||||||
 | 
					        console.clear();
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      case "<": {
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					      case ">": {
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      case " ":
 | 
					      case " ":
 | 
				
			||||||
      case "\r":
 | 
					      case "\r":
 | 
				
			||||||
      default: {
 | 
					      default: {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue