rizonrpg :⁾
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
import sql from "../sql.js";
|
||||
const request = require("request")
|
||||
, xmlparse = require('xml2js').parseString;
|
||||
|
||||
const data = {
|
||||
abschieben: [],
|
||||
@ -346,4 +348,24 @@ module.exports = bot => {
|
||||
}
|
||||
});
|
||||
|
||||
bot._trigger.set("rizonrpg", {
|
||||
call: /^(.|\/)rizonrpg/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];
|
||||
|
||||
request(`http://idlerpg.rizon.net/xml.php?player=${args[0]}`, (err, res, body) => {
|
||||
xmlparse(body, (err, body) => {
|
||||
if(body.player.username.length === 0)
|
||||
return e.reply(`player [b]${args[0]}[/b] was not found`);
|
||||
e.reply(`[b]${body.player.username}[/b], the [b]${body.player.class}[/b]: level: ${body.player.level}, online: ${(body.player.online=="1").toString()}.`);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
Reference in New Issue
Block a user