簡體   English   中英

類型錯誤:無法讀取未定義 discord.js 的屬性“集合”

[英]TypeError: Cannot read property 'Collection' of undefined discord.js

我無法運行腳本,因為我收到錯誤:
TypeError:無法讀取未定義的屬性“集合”

 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()();; });

請幫助我:( (請舉例)

嘗試創建另一個像這樣const Discord = require('discord.js')並將new discord.Collection()更改為new Discord.Collection()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM