trigger rizonrpg -> irpg

This commit is contained in:
Flummi 2017-11-22 13:42:49 +01:00
parent 0520d49a67
commit 0b77b61746

View File

@ -348,8 +348,8 @@ module.exports = bot => {
} }
}); });
bot._trigger.set("rizonrpg", { bot._trigger.set("irpg", {
call: /^(.|\/)rizonrpg/i, call: /^(.|\/)irpg/i,
level: 0, level: 0,
active: true, active: true,
clients: ["irc", "tg"], clients: ["irc", "tg"],
@ -360,8 +360,9 @@ module.exports = bot => {
request(`http://idlerpg.rizon.net/xml.php?player=${args[0]}`, (err, res, body) => { request(`http://idlerpg.rizon.net/xml.php?player=${args[0]}`, (err, res, body) => {
xmlparse(body, (err, body) => { xmlparse(body, (err, body) => {
if(body.player.username.length === 0) if(body.player.username.length <= 1)
return e.reply(`player [b]${args[0]}[/b] was not found`); return e.reply(`player [b]${args[0]}[/b] was not found`);
console.log(body);
e.reply(`[b]${body.player.username}[/b], the [b]${body.player.class}[/b]: level: ${body.player.level}, online: ${(body.player.online=="1").toString()}.`); e.reply(`[b]${body.player.username}[/b], the [b]${body.player.class}[/b]: level: ${body.player.level}, online: ${(body.player.online=="1").toString()}.`);
}); });
}); });