ripple in peace die zweite

This commit is contained in:
2017-12-24 00:11:51 +01:00
parent b05cbccf1e
commit e4e89c3891

View File

@ -21,7 +21,11 @@ export default bot => {
bot._trigger.set("coins", new bot.trigger({ bot._trigger.set("coins", new bot.trigger({
call: /^(\.|\/)(btc|eth|xmr|xrp)/i, call: /^(\.|\/)(btc|eth|xmr|xrp)/i,
f: e => { f: e => {
cryptowat_summary(e.cmd, markets[e.cmd], e.cmd !== "xmr" || e.cmd !== "xrp" ? e.args[0] || "eur" : "usdt").then( let currency = e.args[0] || "eur";
if(e.cmd === "xrp")
currency = "usdt";
cryptowat_summary(e.cmd, markets[e.cmd], currency).then(
resolve => e.reply(resolve), resolve => e.reply(resolve),
reject => e.reply(reject) reject => e.reply(reject)
); );
@ -35,6 +39,7 @@ const cryptowat_summary = (crypto, market, currency) => {
reject(`Can't convert or invalid currency: ${currency}`); reject(`Can't convert or invalid currency: ${currency}`);
rp([{ market: market, crypto: crypto, currency: currency }].map(api_url).join``, { json: true }) rp([{ market: market, crypto: crypto, currency: currency }].map(api_url).join``, { json: true })
.then(res => { .then(res => {
console.log(res);
if (res.length === 0) if (res.length === 0)
reject("No data received"); reject("No data received");
const data = { const data = {