【问题标题】:TypeError: Cannot read property 'Collection' of undefined discord.jsTypeError:无法读取未定义 discord.js 的属性“集合”
【发布时间】:2020-12-15 21:48:48
【问题描述】:

我无法运行脚本,因为我收到错误:
TypeError: Cannot read property 'Collection' of undefined

const fs = require('fs');
const { Client, Util, MessageEmbed, discord} = require("discord.js");
const prefix = (process.env.DISCORD_PREFIX);
const { Player } = require('discord-player');
const bot = new Client({
    disableMentions: "all"
});


bot.player = new Player(bot);
bot.emotes = require('./config/emojis.json');
bot.filters = require('./config/filter.json');
bot.on('message', message => {
    bot.commands = new discord.Collection()();;
});

请帮我:( (请举例)

【问题讨论】:

    标签: javascript discord.js


    【解决方案1】:

    尝试创建另一个像这样const Discord = require('discord.js') 的成本并更改 new discord.Collection()new Discord.Collection()

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-14
      • 2020-07-14
      • 2019-07-11
      • 2021-05-29
      • 2020-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多