diff --git a/commands/help.js b/commands/help.js index fcce176..c0bb007 100644 --- a/commands/help.js +++ b/commands/help.js @@ -2,6 +2,8 @@ const { Broadcast: B, Logger } = require('ranvier'); +const width = 80; +const bar = B.line(width, '-', 'yellow') + '\r\n'; module.exports = { usage: 'help [search] [topic keyword]', @@ -36,9 +38,6 @@ function render(state, hfile) { let body = hfile.body; const name = hfile.name; - const width = 80; - const bar = B.line(width, '-', 'yellow') + '\r\n'; - let header = bar + B.center(width, name, 'white') + '\r\n' + bar; const formatHeaderItem = (item, value) => `${item}: ${value}\r\n\r\n`; @@ -80,9 +79,9 @@ function searchHelpfiles(args, player, state) { const [ _, hfile ] = [...results][0]; return B.sayAt(player, render(state, hfile)); } - B.sayAt(player, "---------------------------------------------------------------------------------"); + B.sayAt(player, bar); B.sayAt(player, "Search Results:"); - B.sayAt(player, "---------------------------------------------------------------------------------"); + B.sayAt(player, bar); for (const [name, help] of results) { B.sayAt(player, `${name}`);