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

TypeError [INVALID_TYPE]:提供的覆蓋不是權(quán)限覆蓋的數(shù)

TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites. Discord v12(TypeError [INVALID_TYPE]:提供的覆蓋不是權(quán)限覆蓋的數(shù)組或集合.不和諧 v12) - IT屋-程序員軟件開發(fā)技術(shù)分
本文介紹了TypeError [INVALID_TYPE]:提供的覆蓋不是權(quán)限覆蓋的數(shù)組或集合.不和諧 v12的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

module.exports = {
    config: {
        name: 'lock',
        aliases: ['lk'], 
        description: "",
        category: "Admin"
    },
    run: async (client, message, args) => {
    const Discord = require('discord.js')

    if(!message.member.hasPermission("MANAGE_MESSAGES", "MANAGE_CHANNELS")) {
    return message.reply(`<@${message.author.id}>, You do not have the permissions`);
    } else if(!message.guild.me.permissions.has("MANAGE_MESSAGES", "MANAGE_CHANNELS")) {
      return message.reply("I don't have Permissions")
    } else {
    
    message.channel.overwritePermissions(message.guild.everyone, {
    SEND_MESSAGES: false,
    ADD_REACTIONS: false
    });

     const embedLock = new Discord.MessageEmbed()
     .setTitle(`Channel successfully blocked! Use !ynlock to Unlock the channel`)
     .setColor("RED")
     const msg = await message.channel.send(embedLock)
    }
    }
}

我正在嘗試讓 !lock 命令阻止每個(gè)人的消息,但是當(dāng)我使用該命令時(shí),機(jī)器人會(huì)發(fā)送嵌入消息:

I'm trying to make the !lock command block everyone's messages, but when I use the command, the bot sends the embed message:

     const embedLock = new Discord.MessageEmbed()
     .setTitle(`Channel successfully blocked! Use !ynlock to Unlock the channel`)
     .setColor("RED")
     const msg = await message.channel.send(embedLock)

但它不會(huì)阻塞消息,并在終端發(fā)送此錯(cuò)誤:

But it does not block messages, and sends this error in the terminal:

TypeError [INVALID_TYPE]: Supplied overwrites is not an Array or Collection of Permission Overwrites

推薦答案

message.channel.overwritePermissions(message.guild.everyone, 
  {
    SEND_MESSAGES: false,
    ADD_REACTIONS: false
   });

其實(shí)是Channel的格式.updateOverwrite().對(duì)于 Channel.overwritePermissions(),改用這個(gè):

Is actually the format for Channel.updateOverwrite(). For Channel.overwritePermissions(), use this instead:

message.channel.overwritePermissions([
  {
     id: message.author.id,
     deny: ['SEND_MESSAGES', 'ADD_REACTIONS'],
  },
]);

這篇關(guān)于TypeError [INVALID_TYPE]:提供的覆蓋不是權(quán)限覆蓋的數(shù)組或集合.不和諧 v12的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機(jī)器人提及發(fā)出該機(jī)器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復(fù)必須使用導(dǎo)入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務(wù)器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復(fù)“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務(wù)器時(shí)的歡迎消息)
主站蜘蛛池模板: 亚洲成人精品国产 | 久久精品这里精品 | 国产日韩一区二区三免费高清 | 欧美日韩国产一区二区三区不卡 | 日本电影一区二区 | 国产一区二区三区在线 | 亚洲人a | 精品一区视频 | 草在线| 国产精品精品视频一区二区三区 | 91亚洲精品国偷拍自产在线观看 | 成人在线视频免费观看 | 在线国产视频观看 | 亚洲最大av | 黄色播放 | 欧美黄色免费网站 | 国产精品久久久久无码av | 日本电影一区二区 | 一区二区三区四区电影视频在线观看 | 国产精品视频一区二区三区 | 欧美日韩亚洲国产 | www.五月婷婷.com | 一级做a毛片 | 成人综合一区二区 | 欧美a区| 国产精品二区三区 | 国产精品无码久久久久 | 久久精品亚洲 | 久久国产精品-国产精品 | 视频在线亚洲 | 亚洲综合一区二区三区 | av三级在线观看 | 国产精品久久国产精品99 gif | 中文字幕一区二区三区在线观看 | 精品国产一区二区三区日日嗨 | 国产成人免费视频 | 日韩综合一区 | 欧美在线视频一区 | 日本久久黄色 | 国产精品欧美一区二区三区不卡 | 在线观看av网站永久 |