[英]Discord.js - @user avatar command not working
const discord = require('discord.js'); // Import the discord.js module
var client = new discord.Client(); // Create an instance of a Discord client
I've declared discord
at the top but continue to get a referencing error, am I missing something extremely obvious?我已经在顶部声明
discord
但继续收到引用错误,我是否遗漏了一些非常明显的东西?
// Send the user's avatar URL
if (message.content.startsWith(config.prefix + "avatar")) {
const user = message.mentions.users.first() || message.author;
const avatarEmbed = new Discord.RichEmbed()
Discord is not defined
, Discord is not defined
,
Discord (with a capital D) is not declared anywhere in the program, Discord(带有大写字母D)未在程序的任何地方声明,
const discord = require('discord.js'); // Import the discord.js module
here you declare "discord" as the discord.js module, so you should be using "discord" instead of "Discord".在这里,您将“discord”声明为 discord.js 模块,因此您应该使用“discord”而不是“Discord”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.