const Discord = require('discord.js') const riotapi = require('../ botconfig.json')
const fetch = require(“ node-fetch”);
const querystring = require('querystring');
module.exports.run =异步(客户端,消息,参数)=> { const champ = args [0]
const Curl = `http://ddragon.leagueoflegends.com/cdn/10.11.1/data/pt_BR/champion/${champ}.json`
const imgUrl = `http://ddragon.leagueoflegends.com/cdn/10.11.1/img/champion/${champ}.png`
console.log(Curl)
message.channel.send("Procurando pelo campeão: " + champ).then(message => message.delete({timeout: 1000}))
fetch(Curl)
.then(res => res.json())
.then(champS => {
let champEmbed = new Discord.MessageEmbed()
.setTitle(`${champ}`)
.setDescription(`${champS.data.champ.title}`)
.addField("Classe", `${champS.data.champ.tags}`)
.addField("Dicas para aprimorar as fights!", `${champS.data.champ.enemytips}`)
.addField("Dicas para ajudar o time!", `${champS.data.champ.allytips}`)
.addField("Passiva", `${champS.data.champ.passive.description}`)
.setThumbnail(imgUrl)
.setColor("RED")
.setFooter("Grandmaster, by: IgorDuca")
message.channel.send(champEmbed)
})
}
答案 0 :(得分:0)
尝试embed.setTitle
或访问此网站进行定义
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined