From 624934c902d84d0d0463534714b0cfcc2756b645 Mon Sep 17 00:00:00 2001 From: hgw Date: Mon, 2 Oct 2023 02:11:25 +0000 Subject: [PATCH] configurable prefix --- bot.js | 8 +++++--- config/example.default.json | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bot.js b/bot.js index 8bef112..585c4ca 100644 --- a/bot.js +++ b/bot.js @@ -79,12 +79,14 @@ async function twitter(chan, provfeed, n) { bot.addListener('message', function(nick, to, text, from) { var args = text.split(' '); - if (args[0] === 'm!help') { + if (args[0] === config.irc.prefix+'help') { help(to, args[1]); - } else if (args[0] === 'm!feed') { + } else if (args[0] === config.irc.prefix+'feed') { feed(to, args[1], args[2]); - } else if (args[0] === 'm!twitter') { + } else if (args[0] === config.irc.prefix+'twitter') { twitter(to, args[1], args[2]) + } else if (args[0] === config.irc.prefix+'set') { + } }); diff --git a/config/example.default.json b/config/example.default.json index f2f1259..209748e 100644 --- a/config/example.default.json +++ b/config/example.default.json @@ -11,7 +11,8 @@ "realname": "git.supernets.org/hogwart7/mercury", "autorejoin": "true", "floodprotection": "false", - "floodprotectiondelay": "0" + "floodprotectiondelay": "0", + "prefix": "m!" }, "colours": { "date": "11",