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

TypeError: message.guild.channels.find(...).then 不是函數

TypeError: message.guild.channels.find(...).then is not a function(TypeError: message.guild.channels.find(...).then 不是函數)
本文介紹了TypeError: message.guild.channels.find(...).then 不是函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這是我從下面的代碼中得到的錯誤:TypeError: message.guild.channels.find(...).then is not a function

This is the error I am getting from my code below: TypeError: message.guild.channels.find(...).then is not a function

        message.guild.channels.find('name', `${message.author.username}-oda`).then(c => {
            channel.overwritePermissions(message.member, {
                CONNECT: true,
                VIEW_CHANNEL: true
            });
            message.channel.send('All Ok.')
        })

推薦答案

由于您對此答案發表評論說您使用的是 discord.js v11 而不是 v12,因此我正在根據以下 TipakA 的評論編輯我的答案.

Since you commented on this answer saying you're using discord.js v11 and not v12 I am editing my answer according to tipakA's comment below.

find 不返回 Promise,因此您不能在其上使用 then.

find does not return a Promise, so you cannot use then on it.

您的解決方案是:

const channel = message.guild.channels.find('name', `${message.author.username}-oda`);
channel.overwritePermissions(message.member, {
                CONNECT: true,
                VIEW_CHANNEL: true
            });
message.channel.send('All Ok.');

這篇關于TypeError: message.guild.channels.find(...).then 不是函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

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(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 在线欧美视频 | 一区二区成人 | 亚洲狠狠爱 | 国产丝袜一区二区三区免费视频 | 殴美成人在线视频 | 天堂av中文在线 | 欧美日韩一区二区三区在线观看 | 99精彩视频| 四虎影院在线播放 | 亚洲精品v | 毛片网站在线观看 | 在线一区视频 | 欧美1区| 精品久久一区二区 | 日韩中文字幕区 | 一区二区在线看 | 久久精品网 | 一区二区三区av | 国产精品69av | 久久男人 | av毛片免费| 成人欧美一区二区三区黑人孕妇 | 91一区 | 久久免费国产视频 | 色一阁| 中文字幕在线播放第一页 | 91免费版在线观看 | 日韩精品一区中文字幕 | 一级毛片免费 | 性网站免费 | 欧美成人激情 | 亚洲淫视频 | 日韩视频免费看 | 亚洲一区二区av | 91国在线视频 | 国产高清免费 | av在线免费观看网站 | 久久久久久久av麻豆果冻 | 欧美精品导航 | 国产不卡在线 | 中文字幕电影在线观看 |