tmp lol
This commit is contained in:
parent
e5eeb0f998
commit
9401eaf578
@ -11,10 +11,10 @@
|
||||
"license": "WTFPL",
|
||||
"dependencies": {
|
||||
"discord.js": "^11.3.0",
|
||||
"jsdom": "^11.4.0",
|
||||
"jsdom": "^11.12.0",
|
||||
"long-timeout": "^0.1.1",
|
||||
"pg-promise": "^7.3.2",
|
||||
"request": "^2.83.0",
|
||||
"request": "^2.87.0",
|
||||
"request-promise": "^4.2.2",
|
||||
"stringify-object": "^3.2.1",
|
||||
"winston": "^2.4.0",
|
||||
|
33
src/inc/trigger/irpg.mjs
Normal file
33
src/inc/trigger/irpg.mjs
Normal file
@ -0,0 +1,33 @@
|
||||
import jsdom from "jsdom";
|
||||
|
||||
export default bot => {
|
||||
bot._trigger.set("irpg", new bot.trigger({
|
||||
call: /^(\.|\/)irpg/i,
|
||||
set: "uwe",
|
||||
active: false,
|
||||
f: e => {
|
||||
const user = e.args[0] || e.user.nick;
|
||||
rp("https://irpg.zneb.org/players.php").then(top => {
|
||||
let prank = 0
|
||||
, i = 1;
|
||||
const dom = new jsdom.JSDOM(top);
|
||||
let playerlist = dom.window.document.querySelectorAll("ol > li");
|
||||
let player = null;
|
||||
for(let p of playerlist) {
|
||||
if (p.innerHTML.includes(`player=${user}">`)) {
|
||||
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]${user}[/b], the [b]${pclass}[/b]: level: ${plevel}, next level in ${puntil}.`);
|
||||
}
|
||||
else
|
||||
e.reply(`player [b]${user}[/b] was not found`);
|
||||
});
|
||||
}
|
||||
}));
|
||||
};
|
@ -1,7 +1,6 @@
|
||||
import sql from "../sql";
|
||||
|
||||
import rp from "request-promise";
|
||||
import jsdom from "jsdom";
|
||||
|
||||
const data = {
|
||||
abschieben: [],
|
||||
@ -258,36 +257,6 @@ export default bot => {
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("irpg", new bot.trigger({
|
||||
call: /^(\.|\/)irpg/i,
|
||||
set: "uwe",
|
||||
f: e => {
|
||||
const user = e.args[0] || e.user.nick;
|
||||
rp("https://v6.zneb.org/players.php").then(top => {
|
||||
let prank = 0
|
||||
, i = 1;
|
||||
const dom = new jsdom.JSDOM(top);
|
||||
let playerlist = dom.window.document.querySelectorAll("ol > li");
|
||||
let player = null;
|
||||
for(let p of playerlist) {
|
||||
if (p.innerHTML.includes(`player=${user}">`)) {
|
||||
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]${user}[/b], the [b]${pclass}[/b]: level: ${plevel}, next level in ${puntil}.`);
|
||||
}
|
||||
else
|
||||
e.reply(`player [b]${user}[/b] was not found`);
|
||||
});
|
||||
|
||||
}
|
||||
}));
|
||||
|
||||
bot._trigger.set("blah", new bot.trigger({
|
||||
call: /^[A-ZÄÖÜẞ](?: [A-ZÄÖÜẞ]){1,5}$/,
|
||||
set: "uwe",
|
||||
|
Loading…
Reference in New Issue
Block a user