Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sgb = require('steam-game-browser')
- const gameName = args.join(' ')
- if (!gameName)
- return message.channel.send(
- 'Add a game name\n\nExample: Grand Theft Auto V'
- )
- sgb.searchByName(gameName, (err, data) => {
- if (err) return message.channel.send('No game found with that name')
- let atg = data.about_the_game.split(' ')
- let resultado = ''
- for (let i = 0; i < atg.length; i++) {
- if (
- (resultado + ' ' + atg[i]).length > 1700 ||
- (resultado + ' ' + atg[i]).length === 1700
- )
- break
- resultado += ' ' + atg[i]
- }
- let sEmbed = new Discord.RichEmbed()
- .setTitle('Steam Game Found!')
- .setDescription(resultado.substring(0, resultado.length - 3) + '...')
- .setThumbnail(data.header_image)
- .addField('Type:', data.type, true)
- .addField(' Name:', data.name, true)
- .addField('ID:', data.steam_appid, true)
- .addField('Required Age:', data.required_age, true)
- .addField('Free?', data.is_free, true)
- .addField('Languages:', data.supported_languages, true)
- .addField(
- 'Game Website',
- `[${gameName} website](${data.website})`,
- true
- )
- .addField(
- 'Support Info:',
- `[Support URL](${data.support_info.url})\n\nEmail: ${
- data.support_info.email
- }`
- )
- .setColor('#A8BCC2')
- message.channel.send(sEmbed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement