brainlet-irc/bots/DinoServ.js

48 lines
1.6 KiB
JavaScript
Raw Normal View History

2021-01-25 07:23:34 +02:00
/*
An IRC bot to annoy people
Copyright (C) 2020 hiimgoodpack
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const ircClient = require("irc");
const brainlet = require("../brainlet-lib/index.js");
module.exports = {
start: (config, {tokens}) => {
let bot = new ircClient.Client("localhost", "DinoServ", {
realName: "A bot to annoy users"
});
bot.addListener("error", console.error);
bot.addListener("message", (from, channel, text, message) => {
if (text.match(/apt-get/))
bot.say(channel, `Hello, annoying bot reporting in, just notifying @${from} that the apt-get command on debian is deprecated. Please use apt instead.
Thank you for attending my TED-talk.`);
if (text.match(/reverse engineer/i)) {
bot.say(channel, `@${from} Watch your language.`);
bot.send("MODE", channel, "-v", from);
bot.notice(from, "You have been muted for 10 seconds.");
setTimeout(() => {
bot.send("MODE", channel, "+v", from);
}, 10000);
}
});
bot.addListener("invite", (channel) => {
bot.join(channel);
});
}
}