.witz
This commit is contained in:
parent
3c6d3b951e
commit
43386da0c7
@ -227,10 +227,10 @@ module.exports = bot => {
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("joke", new bot.trigger({
|
||||
call: /^(\.|\/)joke$/i,
|
||||
bot._trigger.set("witz", new bot.trigger({
|
||||
call: /^(\.|\/)witz$/i,
|
||||
f: e => {
|
||||
rp("http://www.funny4you.at/webmasterprogramm/zufallswitz.php")
|
||||
rp("http://www.funny4you.at/webmasterprogramm/zufallswitz.php?id=312")
|
||||
.then(res => {
|
||||
res = res
|
||||
.split("<br />").join("")
|
||||
@ -241,7 +241,7 @@ module.exports = bot => {
|
||||
.split("ü").join("ü")
|
||||
.split("Ä").join("Ä")
|
||||
.split("Ö").join("Ö")
|
||||
.split("&Üuml;").join("Ü")
|
||||
.split("Ü").join("Ü")
|
||||
.split("ß").join("ß")
|
||||
.split(""").join("\"")
|
||||
.replace(/\<span.*/i, "");
|
||||
@ -259,4 +259,25 @@ module.exports = bot => {
|
||||
});
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("joke", new bot.trigger({
|
||||
call: /^(\.|\/)joke$/i,
|
||||
f: e => {
|
||||
rp("https://icanhazdadjoke.com/slack", { json: true })
|
||||
.then(res => {
|
||||
res = res.attachments[0].text;
|
||||
|
||||
if(e.network !== "Telegram") {
|
||||
res
|
||||
.match(/.{1,450}/g)
|
||||
.map(e.reply);
|
||||
}
|
||||
else
|
||||
e.reply(res);
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
}
|
||||
}));
|
||||
};
|
Loading…
Reference in New Issue
Block a user