const yahooFinance = require('yahoo-finance');

module.exports = () => {
  const logos = {
    'ERD.NZ': '<:eroad:349675137995374592>',
    'OHE.NZ': '<:orion:330132803243212801>',
    'VGL.NZ': '<:vista:349674926736801805>',
  };

  const getLogo = symbol => logos[symbol] || null;
  const getTrend = (quote) => {
    if (quote.price - quote.close > 0) {
      return ':chart_with_upwards_trend:';
    } else if (quote.price - quote.close < 0) {
      return ':chart_with_downwards_trend:';
    }
    return ':expressionless:';
  };

  return new Promise((resolve, reject) => {
    Promise.all([
      yahooFinance.quote({
        symbol: 'OHE.NZ',
        modules: ['price', 'summaryDetail'],
      }),
      yahooFinance.quote({
        symbol: 'ERD.NZ',
        modules: ['price', 'summaryDetail'],
      }),
      yahooFinance.quote({
        symbol: 'VGL.NZ',
        modules: ['price', 'summaryDetail'],
      }),
    ]).then((quotes) => {
      resolve(quotes.map(q => ({
        symbol: q.price.symbol,
        price: q.price.regularMarketPrice,
        close: q.price.regularMarketPreviousClose,
        cap: q.summaryDetail.marketCap,
      }))
      .sort((a, b) => b.cap - a.cap)
      .map(quote =>
          `${getLogo(quote.symbol) || quote.symbol}: \`$${quote.price.toFixed(2)}\` ${getTrend(quote)} \`${Math.abs(quote.price - quote.close).toFixed(2)}\``)
      .reduce((a, b) => `${a}\n${b}`));
    }).catch(err => reject(err));
  });
};

@@ -74,20 +74,25 @@
   const 
-logo
+securitie
 s = %7B%0A  
@@ -262,12 +262,17 @@
  =%3E 
-logo
+securitie
 s%5Bsy
@@ -602,286 +602,74 @@
 all(
-%5B%0A      yahooFinance.quote(%7B%0A        symbol: 'OHE.NZ',%0A        modules: %5B'price', 'summaryDetail'%5D,%0A      %7D),%0A      yahooFinance.quote(%7B%0A        symbol: 'ERD.NZ',%0A        modules: %5B'price', 'summaryDetail'%5D,%0A      %7D),%0A      yahooFinance.quote(%7B%0A        symbol: 'VGL.NZ',%0A       
+Object.keys(securities).map(symbol =%3E yahooFinance.quote(%7B symbol,
  mod
@@ -704,26 +704,18 @@
 il'%5D
-,%0A     
  %7D)
-,
+))
 %0A    
-%5D)
 .the

Change get price to make it easier to add securities