From cebfcfe272094b19c7876d46d84b0b7bebe2dcc6 Mon Sep 17 00:00:00 2001 From: hgw Date: Mon, 2 Oct 2023 02:11:27 +0000 Subject: [PATCH] Make commands case-insensitive --- bot.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bot.js b/bot.js index da3e1ad..ccf6e25 100644 --- a/bot.js +++ b/bot.js @@ -155,13 +155,14 @@ bot.addListener('message', function(nick, to, text, from) { } } else { var args = text.split(' '); - if (args[0] === config.irc.prefix+'help') { + var command = args[0].toLowerCase() + if (command === config.irc.prefix+'help') { help(to, args[1]); - } else if (args[0] === config.irc.prefix+'feed') { + } else if (command === config.irc.prefix+'feed') { feed(to, nick, args[1], args[2]); - } else if (args[0] === config.irc.prefix+'twitter') { + } else if (command === config.irc.prefix+'twitter') { twitter(to, args[1], args[2]) - } else if (args[0] === config.irc.prefix+'opt') { + } else if (command === config.irc.prefix+'opt') { opt(to, nick, args[1], args[2], args[3], args[4]) } msgTimeout.add(to);