'use strict';
exports.info = {
  desc: 'Get the Twitch ID for a specified user.',
  usage: '<name|id>',
  aliases: [],
  permissions: ['SEND_MESSAGES'],
};

const request = require('snekfetch');

exports.run = (client, msg, params = []) => new Promise(async (resolve, reject) => {
  if (params.length === 0) {
    client.utils.usage(msg, exports.info).then(resolve).catch(reject);
    return;
  }
  const query = params.join(' ').trim().toLowerCase();
  const user = await client.twitch.getUserData(query);
  if (!user) {
    msg.channel.send(`The Twitch channel **${params[0]}** does not exist.`).then(resolve).catch(reject);
    return;
  }

  const uri = client.utils.buildUri('https://api.twitch.tv/helix/subscriptions', {
    user_id: user.id,
    broadcaster_id: client.config.twitch.id,
  });
  const subscription = client.utils.get(['body', 'data', 0],
      await request.get(uri)
          .set({
            'Client-ID': client.config.twitch.client_id,
            Authorization: `Bearer ${client.config.twitch.access_token}`,
          }));

  const name = client.twitch.displayName(user);
  const type = `\n${user.broadcaster_type}`;
  const sub = `\nSubscribed: ${Boolean(subscription)}`;
  const str = /^\d+$/.test(query) ?
    `${user.id} => **${name}**${client.utils.capitalize(type)}${sub}}` :
    `${name} => **${user.id}**${client.utils.capitalize(type)}${sub}}`;
  msg.channel.send(str)
    .then(resolve).catch(reject);
});

@@ -1115,16 +1115,40 @@
  = %60%5Cn$%7B
+client.utils.capitalize(
 user.bro
@@ -1160,16 +1160,17 @@
 ter_type
+)
 %7D%60;%0A  co
@@ -1223,20 +1223,18 @@
 n)%7D%60;%0A  
-cons
+le
 t str = 
@@ -1254,20 +1254,16 @@
 query) ?
-%0A   
  %60$%7Buser
@@ -1285,121 +1285,113 @@
 e%7D**
-$%7Bclient.utils.capitalize(type)%7D$%7Bsub%7D%7D%60 :%0A    %60$%7Bname%7D =%3E **$%7Buser.id%7D**$%7Bclient.utils.capitalize(type)%7D$%7Bsub%7D%7D%60
+%60 : %60$%7Bname%7D =%3E **$%7Buser.id%7D**%60;%0A  if (user.broadcaster_type) str += type;%0A  if (subscription) str += sub
 ;%0A  

remove extra }