<commit_before>/*  crypto.js by <NAME> @GlassToeStudio - <EMAIL>

    9 September, 2017
    https://github.com/GlassToeStudio
    http://glasstoestudio.weebly.com/
    https://twitter.com/GlassToeStudio

    ------------------------------------------------------------------------
    Return current price of a given crypto-currency in $US
*/
const GlassBot = require('../bot.js')
const request = require('request')

GlassBot.registerCommand('crypto', 'default', (message, bot) => {
  let address = 'http://www.coincap.io/page/' + message.content.toUpperCase()
  request(address, function (error, response, body) {
    if (error) {
      //  error is always null, but put this here for jstandard: (Expected error to be handled.)
      message.channel.send('Not a valied crypto currency, try BTC.')
      return
    }
    try {
      let btcBody = JSON.parse(body)
      let str = btcBody.price_usd.toString()
      let price = str.slice(0, str.indexOf('.') + 3)
      message.channel.send('The current price for 1 **' + message.content + '** is $**' + price + '** USD.').catch(err => console.log(err.stack))
    } catch (error) {
      message.channel.send('<:doggo:328259712963313665>' + ' Not a valid crypto-currency, try BTC or ETH.')
    }
  })
}, ['crypt', 'price'], 'Get latest crypto currency price.', '[]')<commit_msg>Output currency always upper case<commit_after>/*  crypto.js by <NAME> @GlassToeStudio - <EMAIL>

    9 September, 2017
    https://github.com/GlassToeStudio
    http://glasstoestudio.weebly.com/
    https://twitter.com/GlassToeStudio

    ------------------------------------------------------------------------
    Return current price of a given crypto-currency in $US
*/
const GlassBot = require('../bot.js')
const request = require('request')

GlassBot.registerCommand('crypto', 'default', (message, bot) => {
  let address = 'http://www.coincap.io/page/' + message.content.toUpperCase()
  request(address, function (error, response, body) {
    if (error) {
      //  error is always null, but put this here for jstandard: (Expected error to be handled.)
      message.channel.send('Not a valied crypto currency, try BTC.')
      return
    }
    try {
      let btcBody = JSON.parse(body)
      let str = btcBody.price_usd.toString()
      let price = str.slice(0, str.indexOf('.') + 3)
      message.channel.send('The current price for 1 **' + message.content.toUpperCase() + '** is $**' + price + '** USD.').catch(err => console.log(err.stack))
    } catch (error) {
      message.channel.send('<:doggo:328259712963313665>' + ' Not a valid crypto-currency, try BTC or ETH.')
    }
  })
}, ['crypt', 'price'], 'Get latest crypto currency price.', '[]')
{'fraction_non_alphanumeric': 0.20364854802680565, 'fraction_numerical': 0.0193596425912137, 'mean_word_length': 2.611559139784946, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3172554', 'n_tokens_mistral': 858, 'n_tokens_neox': 813, 'n_words': 214}