diff --git a/src/bot.js b/src/bot.js index 76c0918..588b383 100644 --- a/src/bot.js +++ b/src/bot.js @@ -7,15 +7,17 @@ read().then(() => { let bot = new wrapper(); const self = { - _trigger: new Map() + _trigger: new Map(), + trigger: trigger }; - fs.readdirSync(`${__dirname}/inc/trigger/`).forEach(file => { + /*fs.readdirSync(`${__dirname}/inc/trigger/`).forEach(file => { if(file.substr(-3, 3) === ".js") { logger.info(`(main) loading trigger: ${file}`); require(`${__dirname}/inc/trigger/${file}`)(self); } - }); + });*/ + require(`${__dirname}/inc/trigger/kernel.js`)(self); bot.on("message", e => { // Todo: eventhandler for (var [name, trigger] of self._trigger.entries()) { @@ -38,6 +40,8 @@ read().then(() => { e.reply(`no permission, min level ${trigger.level} required`); break; } + + console.log(trigger); trigger.f(e); } logger.info(`${e.network} -> ${e.channel} -> ${e.user.nick}: ${e.message}`); @@ -46,4 +50,12 @@ read().then(() => { bot.on("ctcp:version", e => { e.write(`notice ${e.user.nick} :\u0001VERSION Pimmel 2.1\u0001`); }); -}); \ No newline at end of file +}); + +function trigger(args, trigger) { + this.call = args.call; + this.level = args.level || 0; + this.active = args.active || true; + this.clients = args.clients || ["irc", "tg"]; + this.f = args.f; +} \ No newline at end of file diff --git a/src/inc/trigger/cfg.js b/src/inc/trigger/cfg.js index a5e7921..1b331f9 100644 --- a/src/inc/trigger/cfg.js +++ b/src/inc/trigger/cfg.js @@ -8,10 +8,9 @@ const _opts = { const _debug = false; module.exports = bot => { - bot._trigger.set("cfg", { + bot._trigger.set("cfg", new bot.trigger({ call: /^\!cfg/i, level: 100, - active: true, clients: ["irc"], f: e => { let args = e.message.substring(5); @@ -91,5 +90,5 @@ module.exports = bot => { } } - }); + })); }; diff --git a/src/inc/trigger/coins.js b/src/inc/trigger/coins.js index 21a359a..5d095e2 100644 --- a/src/inc/trigger/coins.js +++ b/src/inc/trigger/coins.js @@ -15,11 +15,8 @@ const markets = { }; module.exports = bot => { - bot._trigger.set("coins", { + bot._trigger.set("coins", new bot.trigger({ call: /^(\.|\/)(btc|eth|xmr)/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().substr(1).toLowerCase().split(" "); cryptowat_summary(args[0], markets[args[0]], args[0] !== "xmr" ? args[1] : "usd").then( @@ -27,7 +24,7 @@ module.exports = bot => { reject => e.reply(reject) ); } - }); + })); }; const cryptowat_summary = (crypto, market, currency) => { diff --git a/src/inc/trigger/core.js b/src/inc/trigger/core.js index 5a2322f..4de1629 100644 --- a/src/inc/trigger/core.js +++ b/src/inc/trigger/core.js @@ -2,10 +2,9 @@ import sql from "../sql.js"; import { getLevel, loadAdmins } from "../admin.js"; module.exports = bot => { - bot._trigger.set("join", { + bot._trigger.set("join", new bot.trigger({ call: /^\!join .*/i, level: 100, - active: true, clients: ["irc"], f: e => { let args = e.message.trim().substring(6).split(" "); @@ -13,12 +12,11 @@ module.exports = bot => { chans.map(e.join); e.reply(`joined channel${chans.length > 1 ? "s" : null}: ${chans.join(", ")}`); } - }); + })); - bot._trigger.set("part", { + bot._trigger.set("part", new bot.trigger({ call: /^\!part .*/i, level: 100, - active: true, clients: ["irc"], f: e => { let args = e.message.trim().substring(6).split(" "); @@ -26,12 +24,11 @@ module.exports = bot => { chans.map(e.part); e.reply(`parted channel${chans.length > 1 ? "s" : null}: ${chans.join(", ")}`); } - }); + })); - bot._trigger.set("nick", { + bot._trigger.set("nick", new bot.trigger({ call: /^\!nick .*/i, level: 100, - active: true, clients: ["irc"], f: e => { let args = e.message.trim().substring(6).split(" "); @@ -40,12 +37,11 @@ module.exports = bot => { e.whois(args[0]); e.reply(`changed nick to ${args[0]}`); } - }); + })); - bot._trigger.set("level", { + bot._trigger.set("level", new bot.trigger({ call: /^\!level/i, level: 0, - active: true, clients: ["irc"], f: e => { const args = e.message.split(' '); @@ -122,5 +118,5 @@ module.exports = bot => { } } - }); + })); }; \ No newline at end of file diff --git a/src/inc/trigger/debug.js b/src/inc/trigger/debug.js index ffd520c..5a09b4a 100644 --- a/src/inc/trigger/debug.js +++ b/src/inc/trigger/debug.js @@ -9,11 +9,9 @@ let context = vm.createContext({ admins: null, }); module.exports = bot => { - bot._trigger.set("sandbox_debug", { + bot._trigger.set("sandbox_debug", new bot.trigger({ call: /^\!debug (.*)/i, level: 100, - active: true, - clients: ["irc", "tg"], f: e => { const args = e.message.trim().substring(7); try { @@ -34,5 +32,5 @@ module.exports = bot => { e.reply(err.message); } } - }); + })); }; \ No newline at end of file diff --git a/src/inc/trigger/drugs.js b/src/inc/trigger/drugs.js index 0221e86..3dba2d4 100644 --- a/src/inc/trigger/drugs.js +++ b/src/inc/trigger/drugs.js @@ -12,11 +12,8 @@ Object.keys(data).forEach(cur => { }); module.exports = bot => { - bot._trigger.set("dope", { + bot._trigger.set("dope", new bot.trigger({ call: /^(\.|\/)dope/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -32,13 +29,10 @@ module.exports = bot => { e.replyAction(`${action[0]} a ${consume_type} of the finest ${strain_type} "${strain}" ${action[1]} [b]${args[0]}[/b]`); } - }); + })); - bot._trigger.set("meth", { + bot._trigger.set("meth", new bot.trigger({ call: /^(\.|\/)meth/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -46,5 +40,5 @@ module.exports = bot => { e.replyAction(`legt [b]${args[0]}[/b] eine dicke Line Meth \\________`); } - }); + })); }; \ No newline at end of file diff --git a/src/inc/trigger/kernel.js b/src/inc/trigger/kernel.js index e1c3258..105a610 100644 --- a/src/inc/trigger/kernel.js +++ b/src/inc/trigger/kernel.js @@ -3,16 +3,13 @@ const rp = require("request-promise"); const feed = "https://www.kernel.org/releases.json"; module.exports = bot => { - bot._trigger.set("kernel", { + bot._trigger.set("kernel", new bot.trigger({ call: /^(\.|\/)kernel/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { rp(feed).then(content => { const releases = JSON.parse(content).releases; e.reply(releases.map(entry => `[b]${entry.version}[/b] (${entry.moniker}${entry.iseol ? `, [i]EOL[/i]` : ""})`).join(", ")); }); } - }); -}; + })); +} \ No newline at end of file diff --git a/src/inc/trigger/mcmaniac.js b/src/inc/trigger/mcmaniac.js index 0f36010..212980c 100644 --- a/src/inc/trigger/mcmaniac.js +++ b/src/inc/trigger/mcmaniac.js @@ -1,9 +1,8 @@ import sql from "../sql.js"; module.exports = bot => { - bot._trigger.set("mcmaniac_add", { + bot._trigger.set("mcmaniac_add", new bot.trigger({ call: /Mc.*iaC/, - level: 0, active: false, clients: ["irc", "tg"], f: e => { @@ -13,11 +12,10 @@ module.exports = bot => { .then() .catch(err => {}); } - }); + })); - bot._trigger.set("mcmaniac_get", { + bot._trigger.set("mcmaniac_get", new bot.trigger({ call: /^(\.|\/)mcmaniac/i, - level: 0, active: false, clients: ["irc", "tg"], f: e => { @@ -52,5 +50,5 @@ module.exports = bot => { console.log(err); }); } - }); + })); }; \ No newline at end of file diff --git a/src/inc/trigger/parser.js b/src/inc/trigger/parser.js index 00d4874..bbb5961 100644 --- a/src/inc/trigger/parser.js +++ b/src/inc/trigger/parser.js @@ -12,9 +12,8 @@ const _args = [ module.exports = bot => { - bot._trigger.set("parser", { + bot._trigger.set("parser", new bot.trigger({ call: /https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi, - level: 0, active: true, clients: ["irc"], f: e => { @@ -32,7 +31,7 @@ module.exports = bot => { }); } } - }); + })); }; function checkRepost(link) { diff --git a/src/inc/trigger/quotes.js b/src/inc/trigger/quotes.js index 8bdd37a..2ba74de 100644 --- a/src/inc/trigger/quotes.js +++ b/src/inc/trigger/quotes.js @@ -24,11 +24,8 @@ insert into nxy_quotes `; module.exports = bot => { - bot._trigger.set("quotes", { + bot._trigger.set("quotes", new bot.trigger({ call: /^(\.|\/)q .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().substring(3).split(" "); const cmd = args[0].toLowerCase(); @@ -84,5 +81,5 @@ module.exports = bot => { break; } } - }); + })); }; diff --git a/src/inc/trigger/sandbox.js b/src/inc/trigger/sandbox.js index f6c2625..da7c059 100644 --- a/src/inc/trigger/sandbox.js +++ b/src/inc/trigger/sandbox.js @@ -15,11 +15,8 @@ sql.exec("select `data` from `useless` where `trigger` = 'sandbox_js'") }); module.exports = bot => { - bot._trigger.set("sandbox_js", { + bot._trigger.set("sandbox_js", new bot.trigger({ call: /^\!js (.*)/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { const args = e.message.trim().substring(4); if (!_contexts.has(`${e.network}.${e.channel}.${e.user.nick}`)) @@ -55,13 +52,10 @@ module.exports = bot => { e.reply(err.message); } } - }); + })); - bot._trigger.set("sandbox", { + bot._trigger.set("sandbox", new bot.trigger({ call: /^\!(hs|py|cpp|bf|php|lua|bash) .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().substring(1).split(" "); const lang = args.shift(); @@ -72,13 +66,10 @@ module.exports = bot => { reject => e.reply(reject.replace("\n", " ")) ); } - }); + })); - bot._trigger.set("sandbox_rs", { + bot._trigger.set("sandbox_rs", new bot.trigger({ call: /^\!rs (.*)/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { const args = e.message.substring(4); const params = { @@ -102,17 +93,14 @@ module.exports = bot => { e.reply(err); }); } - }); + })); - bot._trigger.set("bfgen", { + bot._trigger.set("bfgen", new bot.trigger({ call: /^\!bfgen .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().substring(7); let output = bfgen(args); e.reply(output.length > maxoutput ? `holy fuck, Ausgabe wäre viel zu lang! (${output.length} Zeichen :DDDDDD)` : output); } - }); + })); }; diff --git a/src/inc/trigger/useless_nxy.js b/src/inc/trigger/useless_nxy.js index 0af9a31..966f6e2 100644 --- a/src/inc/trigger/useless_nxy.js +++ b/src/inc/trigger/useless_nxy.js @@ -17,37 +17,28 @@ Object.keys(data).forEach(cur => { }); module.exports = bot => { - bot._trigger.set("kiss", { + bot._trigger.set("kiss", new bot.trigger({ call: /^(\.|\/)kiss/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(`(づ。◕‿‿◕。)づ" [color=red]。。・゜゜・。。・゜❤[/color] [b]${args.join(" ").trim()}[/b] [color=red]❤[/color]`); } - }); + })); - bot._trigger.set("hug", { + bot._trigger.set("hug", new bot.trigger({ call: /^(\.|\/)hug/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(`[color=red]♡❤♡♥[/color] [b]${args.join(" ").trim()}[/b] [color=red]♥♡❤♡♥[/color]`); } - }); + })); - bot._trigger.set("kill", { + bot._trigger.set("kill", new bot.trigger({ call: /^(\.|\/)kill/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -66,13 +57,10 @@ module.exports = bot => { .replace("{bomb}", data.kill_parts.bomb[~~(Math.random() * data.kill_parts.bomb.length)]) ); } - }); + })); - bot._trigger.set("yiff", { + bot._trigger.set("yiff", new bot.trigger({ call: /^(\.|\/)yiff/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -82,147 +70,113 @@ module.exports = bot => { .split("{user}").join(`[b]${args[0]}[/b]`) .split("{yiffer}").join(`[b]${e.user.nick}[/b]`) .split("{nick}").join(`[b]${e.self.me.nickname}[/b]`) + .split("{channel}").join(`${e.channel}`) ); } - }); + })); - bot._trigger.set("bier", { + bot._trigger.set("bier", new bot.trigger({ call: /^(\.|\/)bier/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(`schenkt ein kühles Blondes an [b]${args[0]}[/b] aus.`); } - }); + })); - bot._trigger.set("fucken", { + bot._trigger.set("fucken", new bot.trigger({ call: /^(\.|\/)fucken/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(`fuckt [b]${args[0]}[/b] und tötet [b]${args[0]}[/b] anschließend.`); } - }); + })); - bot._trigger.set("hack", { + bot._trigger.set("hack", new bot.trigger({ call: /^(\.|\/)hack/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(`hacking ${args[0]}...`); } - }); + })); - bot._trigger.set("spit", { + bot._trigger.set("spit", new bot.trigger({ call: /^(\.|\/)spit/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(`spits on [b]${args[0]}[/b] like a dirty whore.`); } - }); + })); - bot._trigger.set("assume", { + bot._trigger.set("assume", new bot.trigger({ call: /^(\.|\/)assume/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(`Assuming [b]${args[0]}'s[/b] gender... it's a ${data.genders[~~(Math.random() * data.genders.length)]}.`); } - }); + })); - bot._trigger.set("jn", { + bot._trigger.set("jn", new bot.trigger({ call: /^(\.|\/)jn/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply(`${e.user.nick}: [b]${~~(Math.random() * 2) ? "Ja" : "Nein"}[/b]`); } - }); + })); - bot._trigger.set("choose", { + bot._trigger.set("choose", new bot.trigger({ call: /^(\.|\/)choose .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { const args = e.message.substring(8).trim().split(","); if (args.length < 2) return e.reply(`${e.user.nick}: Ob du behindert bist?`); e.reply(`${e.user.nick}: ${args[~~(Math.random() * args.length)].trim()}`); } - }); + })); - bot._trigger.set("huehuehue", { + bot._trigger.set("huehuehue", new bot.trigger({ call: /^huehuehue$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("huehuehue"); } - }); + })); - bot._trigger.set("woah", { + bot._trigger.set("woah", new bot.trigger({ call: /woah/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { if (~~(Math.random() * 4)) e.reply(data.woahs[~~(Math.random() * data.woahs.length)]); } - }); + })); - bot._trigger.set("REEE", { + bot._trigger.set("REEE", new bot.trigger({ call: /reee+$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("R".padEnd(~~(Math.random() * 20 + 10), "E")); } - }); + })); - bot._trigger.set("meme", { + bot._trigger.set("meme", new bot.trigger({ call: /^(\.|\/)meme .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], + active: false, f: e => { const args = e.message.trim().substring(6).split("/"); //if(args.length < 3) return e.reply("[WIP] too few arguments: .meme [meme] / [line 1] / [line 2]"); } - }); + })); - bot._trigger.set("slap", { + bot._trigger.set("slap", new bot.trigger({ call: /^(\.|\/)slap/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -231,16 +185,13 @@ module.exports = bot => { .replace("{user}", `[b]${args[0]}[/b]`) ); } - }); + })); - bot._trigger.set("fw", { + bot._trigger.set("fw", new bot.trigger({ call: /^(\.|\/)fw .*/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { const args = e.message.substring(4).trim(); e.reply(args.toUpperCase().split``.map(c => String.fromCharCode(65312 + (c.charCodeAt(0) - 64))).join``); } - }); + })); }; \ No newline at end of file diff --git a/src/inc/trigger/useless_uwe.js b/src/inc/trigger/useless_uwe.js index 9f67b78..1f87bf6 100644 --- a/src/inc/trigger/useless_uwe.js +++ b/src/inc/trigger/useless_uwe.js @@ -19,60 +19,45 @@ Object.keys(data).forEach(cur => { }); module.exports = bot => { - bot._trigger.set("abschieben", { + bot._trigger.set("abschieben", new bot.trigger({ 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", { + bot._trigger.set("butterkaese", new bot.trigger({ 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", { + bot._trigger.set("notschlachten", new bot.trigger({ 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", { + bot._trigger.set("lachs", new bot.trigger({ call: /^(\.|\/)lachs/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("öhöhöhöhöhöhö"); } - }); + })); - bot._trigger.set("kaffee", { + bot._trigger.set("kaffee", new bot.trigger({ call: /^(\.|\/)kaffee/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -81,13 +66,10 @@ module.exports = bot => { .replace("{user}", `[b]${args[0]}[/b]`) ); } - }); + })); - bot._trigger.set("tee", { + bot._trigger.set("tee", new bot.trigger({ call: /^(\.|\/)tee/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -96,263 +78,197 @@ module.exports = bot => { .replace("{user}", `[b]${args[0]}[/b]`) ); } - }); + })); - bot._trigger.set("uwe_quotes", { + bot._trigger.set("uwe_quotes", new bot.trigger({ 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", { + bot._trigger.set("wusel", new bot.trigger({ 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", { + bot._trigger.set("mett", new bot.trigger({ 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", { + bot._trigger.set("rotenburg", new bot.trigger({ 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", { + bot._trigger.set("pee", new bot.trigger({ 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", { + bot._trigger.set("ike", new bot.trigger({ call: /^ike/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("ike ike!"); } - }); + })); - bot._trigger.set("rip", { + bot._trigger.set("rip", new bot.trigger({ call: /^rip/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("Rust in Peace"); } - }); + })); - bot._trigger.set("haram", { + bot._trigger.set("haram", new bot.trigger({ 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", { + bot._trigger.set("sacklutscher", new bot.trigger({ 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", { + bot._trigger.set("kawaii", new bot.trigger({ call: /kawaii/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("⌒(o^▽^o)ノ so much kawaii"); } - }); + })); - bot._trigger.set("hurrdurr", { + bot._trigger.set("hurrdurr", new bot.trigger({ call: /^hurr$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("durr"); } - }); + })); - bot._trigger.set("fraguwe", { + bot._trigger.set("fraguwe", new bot.trigger({ call: /^uwe.*\?$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("fuck you"); } - }); + })); - bot._trigger.set("wasser", { + bot._trigger.set("wasser", new bot.trigger({ 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", { + bot._trigger.set("normie", new bot.trigger({ 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", { + bot._trigger.set("hyper", new bot.trigger({ call: /^(\.|\/)hyper$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("[b]GET HYPER![/b]"); } - }); + })); - bot._trigger.set("bark", { + bot._trigger.set("bark", new bot.trigger({ call: /^(\.|\/)bark$/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { e.reply("BARK BARK BARK"); } - }); + })); - bot._trigger.set("meditieren", { + bot._trigger.set("meditieren", new bot.trigger({ 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", { + bot._trigger.set("duden", new bot.trigger({ 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", { + bot._trigger.set("kscht", new bot.trigger({ 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", { + bot._trigger.set("bullenpisse", new bot.trigger({ 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", { + bot._trigger.set("lungenkrebs", new bot.trigger({ 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", { + bot._trigger.set("irpg", new bot.trigger({ call: /^(\.|\/)irpg/i, - level: 0, - active: true, - clients: ["irc", "tg"], f: e => { let args = e.message.trim().split(" "); args.shift(); @@ -381,18 +297,15 @@ module.exports = bot => { }); } - }); + })); - bot._trigger.set("blah", { + bot._trigger.set("blah", new bot.trigger({ 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); } - }); - + })); }; \ No newline at end of file