Bug fixes and adding in rollcall
This commit is contained in:
parent
8b6635917e
commit
d81c73e401
19
bot.js
19
bot.js
|
@ -23,7 +23,7 @@ const client = new irc.Client("localhost", botName, {
|
||||||
channels: ["#bots"],
|
channels: ["#bots"],
|
||||||
localAddress: "127.0.0.1",
|
localAddress: "127.0.0.1",
|
||||||
port: 6667,
|
port: 6667,
|
||||||
userName: "aewens",
|
userName: "babilibot",
|
||||||
floodProtection: true,
|
floodProtection: true,
|
||||||
floodProtectionDelay: 1000,
|
floodProtectionDelay: 1000,
|
||||||
autoConnect: false,
|
autoConnect: false,
|
||||||
|
@ -74,7 +74,7 @@ client.tasks = debug ? [] : [
|
||||||
new RSS(
|
new RSS(
|
||||||
client,
|
client,
|
||||||
"links",
|
"links",
|
||||||
"https://links.tildeverse.org/newest.rss",
|
"https://tilde.news/newest.rss",
|
||||||
"title",
|
"title",
|
||||||
["#meta", "#tildeverse"],
|
["#meta", "#tildeverse"],
|
||||||
5000
|
5000
|
||||||
|
@ -82,7 +82,7 @@ client.tasks = debug ? [] : [
|
||||||
new RSS(
|
new RSS(
|
||||||
client,
|
client,
|
||||||
"links-comments",
|
"links-comments",
|
||||||
"https://links.tildeverse.org/comments.rss",
|
"https://tilde.news/comments.rss",
|
||||||
"summary",
|
"summary",
|
||||||
["#tildeverse"],
|
["#tildeverse"],
|
||||||
5000
|
5000
|
||||||
|
@ -299,7 +299,7 @@ const runLogic = (client, from, to, message) => {
|
||||||
|
|
||||||
const tildebridge = new RegExp(/^<~?([^>]+)>\s/);
|
const tildebridge = new RegExp(/^<~?([^>]+)>\s/);
|
||||||
|
|
||||||
if (!message) return false;
|
if (!message || typeof message == "undefined") return false;
|
||||||
|
|
||||||
// Handle bots
|
// Handle bots
|
||||||
if (from === "tildebridge") {
|
if (from === "tildebridge") {
|
||||||
|
@ -386,9 +386,14 @@ const runLogic = (client, from, to, message) => {
|
||||||
message.startsWith("!summon ") ||
|
message.startsWith("!summon ") ||
|
||||||
message.startsWith("!hmmscore") ||
|
message.startsWith("!hmmscore") ||
|
||||||
message.startsWith("!whois ") ||
|
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);
|
const check = checkBlacklist(client, from, to, cheatCode);
|
||||||
if (check) {
|
if (check) {
|
||||||
useCheatCode(client, from, to, cheatCode);
|
useCheatCode(client, from, to, cheatCode);
|
||||||
|
@ -463,4 +468,4 @@ if (!debug) {
|
||||||
|
|
||||||
client.tasks.forEach((task) => {
|
client.tasks.forEach((task) => {
|
||||||
task.start();
|
task.start();
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,8 @@ module.exports = class Summon {
|
||||||
}
|
}
|
||||||
|
|
||||||
const subject = "You have been summoned!";
|
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} a summoning request for you`;
|
||||||
text = `${text} from ${this.summoner}`;
|
text = `${text} from ${this.summoner}`;
|
||||||
text = `${text} in channel ${this.channel}`;
|
text = `${text} in channel ${this.channel}`;
|
||||||
|
@ -71,7 +72,7 @@ module.exports = class Summon {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.transporter.sendMail({
|
this.transporter.sendMail({
|
||||||
from: this.client.config.email,
|
from: `${botName}@tilde.team`,
|
||||||
to: email,
|
to: email,
|
||||||
subject: subject,
|
subject: subject,
|
||||||
text: text
|
text: text
|
||||||
|
|
Loading…
Reference in New Issue