From d81c73e4017b80054a479898ca1e487fcf04e249 Mon Sep 17 00:00:00 2001 From: aewens Date: Tue, 28 Aug 2018 12:46:51 -0400 Subject: [PATCH] Bug fixes and adding in rollcall --- bot.js | 19 ++++++++++++------- spells/summon.js | 5 +++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/bot.js b/bot.js index a06fc3a..c9aa02a 100644 --- a/bot.js +++ b/bot.js @@ -23,7 +23,7 @@ const client = new irc.Client("localhost", botName, { channels: ["#bots"], localAddress: "127.0.0.1", port: 6667, - userName: "aewens", + userName: "babilibot", floodProtection: true, floodProtectionDelay: 1000, autoConnect: false, @@ -74,7 +74,7 @@ client.tasks = debug ? [] : [ new RSS( client, "links", - "https://links.tildeverse.org/newest.rss", + "https://tilde.news/newest.rss", "title", ["#meta", "#tildeverse"], 5000 @@ -82,7 +82,7 @@ client.tasks = debug ? [] : [ new RSS( client, "links-comments", - "https://links.tildeverse.org/comments.rss", + "https://tilde.news/comments.rss", "summary", ["#tildeverse"], 5000 @@ -299,7 +299,7 @@ const runLogic = (client, from, to, message) => { const tildebridge = new RegExp(/^<~?([^>]+)>\s/); - if (!message) return false; + if (!message || typeof message == "undefined") return false; // Handle bots if (from === "tildebridge") { @@ -386,9 +386,14 @@ const runLogic = (client, from, to, message) => { message.startsWith("!summon ") || message.startsWith("!hmmscore") || message.startsWith("!whois ") || - message.startsWith("!botlist") + message.startsWith("!botlist") || + message.startsWith("!rollcall") ) { - const cheatCode = message.slice(1).trim(); + // Alias botlist to rollcall because I don't know, khuxkm said so? + let cheatCode = message.slice(1).trim(); + if (message.startsWith("!rollcall")) { + cheatCode = "botlist"; + } const check = checkBlacklist(client, from, to, cheatCode); if (check) { useCheatCode(client, from, to, cheatCode); @@ -463,4 +468,4 @@ if (!debug) { client.tasks.forEach((task) => { task.start(); -}); \ No newline at end of file +}); diff --git a/spells/summon.js b/spells/summon.js index c94105d..612dc11 100644 --- a/spells/summon.js +++ b/spells/summon.js @@ -59,7 +59,8 @@ module.exports = class Summon { } const subject = "You have been summoned!"; - let text = `My bot, ${this.client.config.botName}, received`; + const botName = this.client.config.botName; + let text = `My bot, ${botName}, received`; text = `${text} a summoning request for you`; text = `${text} from ${this.summoner}`; text = `${text} in channel ${this.channel}`; @@ -71,7 +72,7 @@ module.exports = class Summon { } this.transporter.sendMail({ - from: this.client.config.email, + from: `${botName}@tilde.team`, to: email, subject: subject, text: text