久久久久久久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í)的歡迎消息)
主站蜘蛛池模板: 日韩欧美中文 | 精品欧美乱码久久久久久1区2区 | 亚洲天堂av一区 | 99精品一级欧美片免费播放 | 99国产精品久久久 | 日本欧美在线观看视频 | 一区二区视频 | 一区二区国产精品 | 国产99久久精品一区二区永久免费 | 免费亚洲成人 | 欧美黄色一区 | 欧美激情在线精品一区二区三区 | a精品视频 | 国产精品亚洲第一区在线暖暖韩国 | 操久久| 日本免费一区二区三区 | 欧美日韩一区二区三区四区五区 | 精品一区二区三 | www.蜜桃av | 精品国产一区二区三区免费 | 亚洲精品乱码久久久久久按摩观 | 国产一区二区久久久 | 精品久久久久久亚洲精品 | 操操日| 99爱国产 | 亚洲一区二区在线免费观看 | 九九精品在线 | 欧美日韩在线播放 | 一区中文字幕 | 久久久国产一区二区三区 | 精品91久久 | 欧美精品一区二区三区在线播放 | 亚洲激情在线视频 | 日韩国产中文字幕 | 理论片午午伦夜理片影院 | 久久国产精品-国产精品 | 国产精品亚洲一区 | 亚洲视频免费在线观看 | 精品欧美一区二区三区免费观看 | 一区二区三区四区在线视频 | 欧美成人一区二免费视频软件 |