nxy: einschläfern & joke

This commit is contained in:
Flummi 2017-12-01 15:40:06 +01:00
parent 42e2ad69ec
commit 3c6d3b951e

View File

@ -219,4 +219,44 @@ module.exports = bot => {
});
}
}));
bot._trigger.set("einschlaefern", new bot.trigger({
call: /^(\.|\/)einschläfern/i,
f: e => {
e.replyAction(`schläfert [b]${e.args[0] || e.user.nick}[/b] mit einer Spritze Ketamin ein.`);
}
}));
bot._trigger.set("joke", new bot.trigger({
call: /^(\.|\/)joke$/i,
f: e => {
rp("http://www.funny4you.at/webmasterprogramm/zufallswitz.php")
.then(res => {
res = res
.split("<br />").join("")
.split("<div class=\"funny4you\">").join("")
.split("&amp;").join("&")
.split("&auml;").join("ä")
.split("&ouml;").join("ö")
.split("&uuml;").join("ü")
.split("&Auml;").join("Ä")
.split("&Ouml;").join("Ö")
.split("&Üuml;").join("Ü")
.split("&szlig;").join("ß")
.split("&quot;").join("\"")
.replace(/\<span.*/i, "");
if(e.network !== "Telegram") {
res
.match(/.{1,450}/g)
.map(e.reply);
}
else
e.reply(res);
})
.catch(err => {
console.log(err);
});
}
}));
};