398 lines
11 KiB
JavaScript
398 lines
11 KiB
JavaScript
import sql from "../sql.js";
|
||
const rp = require("request-promise")
|
||
, jsdom = require("jsdom").JSDOM;
|
||
|
||
const data = {
|
||
abschieben: [],
|
||
kaffee: [],
|
||
tee: [],
|
||
quotes_firecooler: [],
|
||
quotes_kinski: [],
|
||
quotes_stoll: [],
|
||
quotes_boll: []
|
||
};
|
||
|
||
Object.keys(data).forEach(cur => {
|
||
sql.exec(`select \`data\` from \`useless\` where \`trigger\` = '${cur}' limit 1`, (err, row) => {
|
||
data[cur] = JSON.parse(row[0].data);
|
||
});
|
||
});
|
||
|
||
module.exports = bot => {
|
||
bot._trigger.set("abschieben", {
|
||
call: /^(\.|\/)abschieben/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`schiebt [b]${args[0]}[/b] ${data.abschieben[~~(Math.random() * data.abschieben.length)]} ab.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("butterkaese", {
|
||
call: /^(\.|\/)butterkäse/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`drischt mit einem großen Stück Butterkäse auf [b]${args[0]}[/b] ein.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("notschlachten", {
|
||
call: /^(\.|\/)notschlachten/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`notschlachtet [b]${args[0]}[/b] und entsorgt die Leiche im Biomüll`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("lachs", {
|
||
call: /^(\.|\/)lachs/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("öhöhöhöhöhöhö");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("kaffee", {
|
||
call: /^(\.|\/)kaffee/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(data.kaffee[~~(Math.random() * data.kaffee.length)]
|
||
.replace("{user}", `[b]${args[0]}[/b]`)
|
||
);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("tee", {
|
||
call: /^(\.|\/)tee/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(data.tee[~~(Math.random() * data.tee.length)]
|
||
.replace("{user}", `[b]${args[0]}[/b]`)
|
||
);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("uwe_quotes", {
|
||
call: /^(\.|\/)(boll|firecooler|kinski|stoll)$/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().substring(1);
|
||
e.reply(data[`quotes_${args}`][~~(Math.random() * data[`quotes_${args}`].length)]);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("wusel", {
|
||
call: /^(\.|\/)wusel/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`wuselt [b]${args[0]}[/b] über den Haufen.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("mett", {
|
||
call: /^(\.|\/)mett/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.reply(`Jamba Mettscanner: [b]${args[0]}[/b] ist zu ${~~(Math.random() * 100 + 1)}% Mett.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("rotenburg", {
|
||
call: /^(\.|\/)rotenburg/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`verarbeitet [b]${args[0]}[/b] zu Hackfleisch.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("pee", {
|
||
call: /^(\.|\/)pee/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`pisst in [b]${args[0]}[/b]s Gesicht.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("ike", {
|
||
call: /^ike/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("ike ike!");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("rip", {
|
||
call: /^rip/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("Rust in Peace");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("haram", {
|
||
call: /^(\.|\/)haram/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.reply(`[b]${args[0]}[/b] ist ${(~~(Math.random() * 2) ? "haram" : "nicht haram")}.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("sacklutscher", {
|
||
call: /^(\.|\/)lutschsack/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.reply(`[b]${e.user.nick}[/b] legt Rosen aus und lutscht den Sack von [b]${args[0]}[/b]`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("kawaii", {
|
||
call: /kawaii/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("⌒(o^▽^o)ノ so much kawaii");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("hurrdurr", {
|
||
call: /^hurr$/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("durr");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("fraguwe", {
|
||
call: /^uwe.*\?$/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("fuck you");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("wasser", {
|
||
call: /^(\.|\/)wasser/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`kippt [b]${args[0]}[/b] einen Eimer Wasser über den Kopf.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("normie", {
|
||
call: /^(\.|\/)normie/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.reply(`Jamba Normiescanner: [b]${args[0]}[/b] ist zu ${~~(Math.random() * 100 + 1)}% ein Normie.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("hyper", {
|
||
call: /^(\.|\/)hyper$/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("[b]GET HYPER![/b]");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("bark", {
|
||
call: /^(\.|\/)bark$/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
e.reply("BARK BARK BARK");
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("meditieren", {
|
||
call: /^(\.|\/)meditieren/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`meditiert zusammen mit [b]${args[0]}[/b] Metta.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("duden", {
|
||
call: /^(\.|\/)duden/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`drischt mit einem großen Duden auf [b]${args[0]}[/b] ein.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("kscht", {
|
||
call: /^(\.|\/)kscht/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`jagt [b]${args[0]}[/b] durch den Raum.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("bullenpisse", {
|
||
call: /^(\.|\/)bullenpisse/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`zapft ein Fläschchen feinsten Bullenurin, verarbeitet diesen zu Red-Bull und serviert ihn [b]${args[0]}[/b] in Form einer Pfanddose.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("lungenkrebs", {
|
||
call: /^(\.|\/)lungenkrebs/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
e.replyAction(`dreht [b]${args[0]}[/b] einen prall gefüllten Sargnagel mit feinstem Schwarzer Krauser.`);
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("irpg", {
|
||
call: /^(\.|\/)irpg/i,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc", "tg"],
|
||
f: e => {
|
||
let args = e.message.trim().split(" ");
|
||
args.shift();
|
||
args[0] = (args[0] == String.empty || typeof args[0] === "undefined" || args[0] == "") ? e.user.nick : args[0];
|
||
|
||
rp("http://idlerpg.rizon.net/players.php").then(top => {
|
||
let prank = 0
|
||
, i = 1;
|
||
const dom = new jsdom(top);
|
||
let playerlist = dom.window.document.querySelectorAll("ol > li");
|
||
let player = null;
|
||
for(let p of playerlist) {
|
||
if (p.innerHTML.includes(`player=${args[0]}">`)) {
|
||
prank = i;
|
||
player = p;
|
||
break;
|
||
}
|
||
i++;
|
||
}
|
||
if(player !== null) {
|
||
const [, plevel, pclass, puntil] = player.innerHTML.match(/.*, the level (.*?) (.*?)\. Next level in (.*?)\./);
|
||
e.reply(`([i]${prank} / ${playerlist.length}[/i]) [b]${args[0]}[/b], the [b]${pclass}[/b]: level: ${plevel}, next level in ${puntil}.`);
|
||
}
|
||
else
|
||
e.reply(`player [b]${args[0]}[/b] was not found`);
|
||
});
|
||
|
||
}
|
||
});
|
||
|
||
bot._trigger.set("blah", {
|
||
call: /^[A-ZÄÖÜẞ](?: [A-ZÄÖÜẞ]){1,5}$/,
|
||
level: 0,
|
||
active: true,
|
||
clients: ["irc"],
|
||
f: e => {
|
||
let args = e.message.trim();
|
||
if (args.toUpperCase() === args)
|
||
args.substring(2).split(" ").forEach(e.reply);
|
||
}
|
||
});
|
||
|
||
}; |