From fc2ff4c028ce051a5ed46de6ad4956a7891f3d49 Mon Sep 17 00:00:00 2001 From: hgw Date: Mon, 2 Oct 2023 02:11:26 +0000 Subject: [PATCH] add MOTD support to help dialogue --- commands/help.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/commands/help.js b/commands/help.js index e67faf4..441e42d 100644 --- a/commands/help.js +++ b/commands/help.js @@ -46,19 +46,28 @@ async function help(sub) { } if (sub === "default") { if (config.misc.display_help_logo === 'true' ) { + var randomMOTD = config.motd.list[Math.floor(Math.random() * config.motd.list.length)]; consoleLog('[help.default] Logo enabled, including in output') content.push(''+config.colours.help_logo+' ____ ___ ___ ____________ _________ __') content.push(''+config.colours.help_logo+' / __ `__ \\/ _ \\/ ___/ ___/ / / / ___/ / / /') content.push(''+config.colours.help_logo+' / / / / / / __/ / / /__/ /_/ / / / /_/ / ') content.push(''+config.colours.help_logo+'/_/ /_/ /_/\\___/_/ \\___/\\__,_/_/ \\__, / ') - content.push(''+config.colours.help_logo+' /____/ ') + if (config.motd.enable == "true") { + content.push(''+config.colours.help_motd+' '+randomMOTD.padEnd(35)+''+config.colours.help_logo+'/____/ ') + } else if (config.motd.enable == "version" ) { + content.push(''+config.colours.help_motd+' '+config.motd.version.padEnd(35)+''+config.colours.help_logo+'/____/ ') + } else if (config.motd.enable == "false" || config.motd.emable != "true" || config.motd.enable != "version") { + content.push(''+config.colours.help_logo+' /____/ ') + } + } else if (config.misc.display_help_logo !== 'true') { consoleLog('[help.default] Logo disabled, not including in output') } - content.push('Mercury RSS Client - https://git.supernets.org/hogwart7/mercury') + content.push('Mercury RSS Client - https://git.supernets.org/hgw/mercury') content.push('m!feed [USER/FEED/ALIAS] [ENTRIES] - Return the last x amount of entries from any RSS feed or your own saved feeds (if you have saved feeds)') content.push("m!twitter [USER] [ENTRIES] - Return the last x amount of tweets from a particular user") content.push("m!opt [CATEGORY] [OPTION] [VALUE] - Control bot options, see wiki for info on usage.") + content.push('m!help - Brings up this dialogue') sendUpstream(content) } }