LoginSignup
1
1

【Discord.js】Discord.MessageEmbed is not a constructor

Last updated at Posted at 2023-01-17

エラー内容

Discord.jsでボットを開発していたときの話。Embedオブジェクトを生成しようと、

const template = new Discord.MessageEmbed()

としたら、

Discord.MessageEmbed is not a constructor

というエラー発生。

解決策

v14になってクラスの名前が変わったらしい。MessageEmbedからEmbedBuilderに変更すればよし。

const template = new Discord.EmbedBuilder()
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1