This commit is contained in:
Flummi 2019-08-22 13:51:02 +00:00
parent 8c5fb99cd3
commit bb98bccf9a
5 changed files with 72 additions and 27 deletions

View File

@ -0,0 +1,14 @@
import fetch from "flumm-fetch-cookies";
import config from "../../../cfg/config.json";
export default async bot => {
return [{
name: "googlesearch",
call: /^(\.|\/)google/i,
f: async e => {
const res = await (await fetch(`https://www.googleapis.com/customsearch/v1?q=${e.args.join(" ")}&num=3&cx=${config.apis.google.cx}&key=${config.apis.google.key}`)).json();
e.reply([ "Here are the top 3 Google results:", res.items.map((r, i) => `${i+1}: ${r.title} - ${r.link}`)].flat());
}
}];
};

View File

@ -0,0 +1,56 @@
const dict = {
upper: [..."𝔸𝔹𝔻𝔼𝔽𝔾𝕀𝕁𝕂𝕃𝕄𝕆𝕊𝕋𝕌𝕍𝕎𝕏𝕐"],
lower: [..."𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫"],
digit: [..."𝟘𝟙𝟚𝟛𝟜𝟝𝟞𝟟𝟠𝟡"]
};
const range = {
upper: [ 56, 90 ],
lower: [ 97, 122],
digit: [ 48, 57 ]
};
export default async bot => {
return [{
name: "fancytext",
call: /^(\.|\/)ft/i,
f: async e => {
e.reply(
[...e.args.join(" ")].map(b => {
const char = b.charCodeAt(0);
if(char >= range.upper[0] && char <= range.upper[1])
return dict.upper[char - range.upper[0] - 9];
else if(char >= range.lower[0] && char <= range.lower[1])
return dict.lower[char - range.lower[0]];
else if(char >= range.digit[0] && char <= range.digit[1])
return dict.digit[char - range.digit[0]];
else return b;
}).join``
);
}
}, {
name: "blah",
call: /^[A-ZÄÖÜẞ](?: [A-ZÄÖÜẞ]){1,5}$/,
set: "uwe",
clients: ["irc"],
f: e => {
let args = e.message.trim();
if (args.toUpperCase() === args) e.reply(args.substring(2).split(" ").join("\n"));
}
}, {
name: "fw",
call: /^(\.|\/)fw .*/i,
set: "nxy",
f: e => {
const args = e.message.substring(4).trim();
e.reply([...args.toUpperCase()].map(c => c === ' ' ? ' ' : String.fromCharCode(65248 + c.charCodeAt(0))).join``);
}
}, {
name: "mock",
call: /^\.mock .*/i,
set: "uwe",
f: e => {
e.reply([...e.args.join(" ")].map(l => (l === " ") ? " " : (Math.round(Math.random()) === 0) ? l.toUpperCase() : l.toLowerCase()).join``);
}
}];
};

View File

@ -112,7 +112,7 @@ export default async bot => {
e.reply(`${e.user.nick}: [b]${~~(Math.random() * 2) ? "Ja" : "Nein"}[/b]`);
}
}, {
name: "chosse",
name: "choose",
call: /^(\.|\/)choose .*/i,
set: "nxy",
f: e => {
@ -163,14 +163,6 @@ export default async bot => {
.replace("{user}", `[b]${e.args[0] || e.user.nick}[/b]`)
);
}
}, {
name: "fw",
call: /^(\.|\/)fw .*/i,
set: "nxy",
f: e => {
const args = e.message.substring(4).trim();
e.reply([...args.toUpperCase()].map(c => c === ' ' ? ' ' : String.fromCharCode(65248 + c.charCodeAt(0))).join``);
}
}, {
name: "waifu_husbando",
call: /^(\.|\/)(waifu|husbando)/i,

View File

@ -228,15 +228,6 @@ export default async bot => {
f: e => {
e.replyAction(`dreht [b]${e.args[0] || e.user.nick}[/b] einen prall gefüllten Sargnagel mit feinstem Schwarzer Krauser.`);
}
}, {
name: "blah",
call: /^[A-ZÄÖÜẞ](?: [A-ZÄÖÜẞ]){1,5}$/,
set: "uwe",
clients: ["irc"],
f: e => {
let args = e.message.trim();
if (args.toUpperCase() === args) e.reply(args.substring(2).split(" ").join("\n"));
}
}, {
name: "rose",
call: /^(\.|\/)rose/i,
@ -289,13 +280,6 @@ export default async bot => {
});
e.write(`privmsg ${e.args[0] || e.user.nick} :\u0001VERSION\u0001`);
}
}, {
name: "mock",
call: /^\.mock .*/i,
set: "uwe",
f: e => {
e.reply([...e.args.join(" ")].map(l => (l === " ") ? " " : (Math.round(Math.random()) === 0) ? l.toUpperCase() : l.toLowerCase()).join``);
}
}, { ///
name: "sync",
call: /^\.sync.*/i,

View File

@ -14,9 +14,8 @@ export default async bot => {
},
clients: ["irc"],
f: e => {
//return e.reply("wttr.in saugt. Bitte .weather nutzen.");
let args = e.message.trim().substring(6);
let options = {
const options = {
headers: {
'User-Agent': 'curl/7.43.0',
'accept-language': 'de-DE,de'