Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const sgb = require('steam-game-browser')
  2.         const gameName = args.join(' ')
  3.         if (!gameName)
  4.             return message.channel.send(
  5.                 'Add a game name\n\nExample: Grand Theft Auto V'
  6.             )
  7.         sgb.searchByName(gameName, (err, data) => {
  8.             if (err) return message.channel.send('No game found with that name')
  9.             let atg = data.about_the_game.split(' ')
  10.             let resultado = ''
  11.             for (let i = 0; i < atg.length; i++) {
  12.                 if (
  13.                     (resultado + ' ' + atg[i]).length > 1700 ||
  14.                     (resultado + ' ' + atg[i]).length === 1700
  15.                 )
  16.                     break
  17.                 resultado += ' ' + atg[i]
  18.             }
  19.             let sEmbed = new Discord.RichEmbed()
  20.                 .setTitle('Steam Game Found!')
  21.                 .setDescription(resultado.substring(0, resultado.length - 3) + '...')
  22.                 .setThumbnail(data.header_image)
  23.                 .addField('Type:', data.type, true)
  24.                 .addField(' Name:', data.name, true)
  25.                 .addField('ID:', data.steam_appid, true)
  26.                 .addField('Required Age:', data.required_age, true)
  27.                 .addField('Free?', data.is_free, true)
  28.                 .addField('Languages:', data.supported_languages, true)
  29.                 .addField(
  30.                     'Game Website',
  31.                     `[${gameName} website](${data.website})`,
  32.                     true
  33.                 )
  34.                 .addField(
  35.                     'Support Info:',
  36.                     `[Support URL](${data.support_info.url})\n\nEmail: ${
  37.                         data.support_info.email
  38.                     }`
  39.                 )
  40.                 .setColor('#A8BCC2')
  41.             message.channel.send(sEmbed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement