[英]I can not find the error discord.js giphy/hug command
const GphApiClient = require("giphy-js-sdk-core");
var giphy = GphApiClient ;
exports.run = (bot, message, args, client) => {
giphy.search("gifs", { q: "fail" })
.then(response => {
var totalResponses = response.data.length;
var responseIndex = Math.floor((Math.random() * 10) + 1) % totalResponses;
var responseFinal = response.data[responseIndex]
const embed = new Discord.RichEmbed() // Here is my problem it says 'Discord' is not defined
.setAuthor('x')
.setColor('RANDOM')
.setTimestamp()
.setDescription('')
.setImage(responseFinal.images.fixed_height.url)
message.channel.send(embed)
}
)
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 0
};
exports.help = {
name: 'hug',
description: 'Free Hug!',
usage: 'hug'
};
I need help:c I just started to coding.我需要帮助:c 我刚开始编码。 I dont know what's the error it just says我不知道它刚刚说的错误是什么
'Discord' is not defined “不和谐”未定义
If you find the error please dm me on discord.如果您发现错误,请在 discord 上联系我。 Wanheda#2722万和达#2722
You need to require
discord.js:您需要require
discord.js:
const Discord = require("discord.js");
// rest of code...
I dont know what's the error我不知道是什么错误
The error is 'Discord' is not defined
, which means that Node.js saw Discord
in Discord.RichEmbed
and tried to get its value, but there is no variable Discord
. The error is 'Discord' is not defined
, which means that Node.js saw Discord
in Discord.RichEmbed
and tried to get its value, but there is no variable Discord
.
See ReferenceError: "x" is not defined on MDN .请参阅ReferenceError: "x" is not defined on MDN 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.