Bug fixes and adding in rollcall

This commit is contained in:
aewens 2018-08-28 12:46:51 -04:00
parent 8b6635917e
commit d81c73e401
2 changed files with 15 additions and 9 deletions

19
bot.js
View File

@ -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();
});
});

View File

@ -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