久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

升級(jí)到 v13 時(shí) Discord.js v12 代碼中斷

Discord.js v12 code breaks when upgrading to v13(升級(jí)到 v13 時(shí) Discord.js v12 代碼中斷)
本文介紹了升級(jí)到 v13 時(shí) Discord.js v12 代碼中斷的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

將我的 discord.js 更新到 v13 時(shí),我遇到了很多錯(cuò)誤:

When updating my discord.js to v13 there are many errors I get:

//member.hasPermission is not a function
member.hasPermission("SEND_MESSAGES")

//Cannot send an empty message
channel.send(someEmbed)

//Cannot send an empty message
channel.send({embed: someEmbed})

//Warning: The 'message' event was deprecated, use 'messageCreate' instead
client.on("message", msg => {})

//Cannot send an empty message
channel.send(user)

//[CLIENT_MISSING_INTENTS] Valid intents must be provided for the client
const client = new Client()

//channel.join is not a function
await channel.join()

這些在 v12 中不會(huì)發(fā)生,那么如何在 v13 中修復(fù)它們?

These don't happen in v12, so how do I fix them in v13?

推薦答案

Discord.js v13 有很多變化,這只是其中的一小部分.在更新到 v13 之前,您應(yīng)該更改以下內(nèi)容

Discord.js v13 has a lot of changes, and those are only a few. Before updating to v13, you should change the following things

//member.hasPermission("SEND_MESSAGES")
member.permissions.has("SEND_MESSAGES")

//channel.send(someEmbed) / channel.send({embed: someEmbed})
channel.send({ embeds: [someEmbed] }) //make sure it's an array!

//client.on("message", msg => {})
client.on("messageCreate", msg => {})

//channel.send(user)
channel.send(user.toString())

//const client = new Client()
const { Intents, Client } = require("discord.js")
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]}) //more intents may be provided

//await channel.join()
const { joinVoiceChannel } = require("@discordjs/voice") //requires installation
joinVoiceChannel({
  channelId: channel.id,
  guildId: guild.id,
  adapterCreator: guild.voiceAdapterCreator
})

還有一些變化.您可以在 指南中看到它們

There are some more changes. You can see them in the guide

這篇關(guān)于升級(jí)到 v13 時(shí) Discord.js v12 代碼中斷的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Using discord.js to detect image and respond(使用 discord.js 檢測(cè)圖像并響應(yīng))
Check if user ID exists in Discord server(檢查 Discord 服務(wù)器中是否存在用戶 ID)
Guild Member Add does not work (discordjs)(公會(huì)成員添加不起作用(discordjs))
Creating my first bot using REPLIT but always error Discord.JS(使用 REPLIT 創(chuàng)建我的第一個(gè)機(jī)器人,但總是錯(cuò)誤 Discord.JS)
How do I code event/command handlers for my Discord.js bot?(如何為我的 Discord.js 機(jī)器人編寫事件/命令處理程序?)
How to find a User ID from a Username in Discord.js?(如何從 Discord.js 中的用戶名中查找用戶 ID?)
主站蜘蛛池模板: 国产区免费视频 | 日本视频中文字幕 | 国产九九九| 亚洲在线一区 | 日韩综合网 | 在线免费看黄 | 欧美一级片在线观看 | 一级欧美一级日韩片免费观看 | 在线观看日本高清二区 | 欧美成人精品一区二区男人看 | 国产一区二区视频在线观看 | 日本一区二区不卡 | 国产精品久久久久久久久久免费 | 伊人狠狠操 | 久久国产成人 | 午夜成人免费视频 | 亚洲日韩中文字幕一区 | 毛片黄片免费看 | 日韩a在线 | 久久综合一区二区 | 亚洲精品一区二区三区蜜桃久 | 成人av免费在线观看 | 国产一区二区三区色淫影院 | 国产成人综合网 | 国产日韩一区二区三区 | 狠狠的操 | 亚洲精品乱码 | 国产精品久久网 | 欧美性视频在线播放 | 精品国产乱码久久久久久丨区2区 | 国产精品国产精品国产专区不片 | 爱操av | 亚州影院 | 国产999精品久久久 精品三级在线观看 | 一区二区三区久久久 | 久久在线免费 | 在线免费观看黄视频 | 99re在线 | 国产成人精品一区二三区在线观看 | 精品久久久久一区 | 91精品国产一区二区三区蜜臀 |