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

Discord.js 禁止命令中的無效表單正文

Invalid Form Body in Discord.js ban command(Discord.js 禁止命令中的無效表單正文)
本文介紹了Discord.js 禁止命令中的無效表單正文的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

所以,我一直在嘗試發出禁令命令.我基本上在踢命令上使用了相同的系統,但在這里它不起作用,只是給了我一個錯誤.我很困惑,因為在錯誤中它沒有顯示一行代碼或其他東西.
我的命令/代碼:

So, i have been trying to make a ban command. I basically used the same system on a kick command, but here it didnt work and just gave me an error. I am confused since in the error it doesnt display a line of code or something.
My Command / Code:

module.exports = {
    name: 'ban',
    description: "Ban Command.",
    execute(msg, args){
    const Discord = require('discord.js')
    const Embeds = require('./../embed')
    let perms = msg.member.permissions  
    let has_kick = perms.has("BAN_MEMBERS")
    if (has_kick === true) {
        const toban = msg.mentions.members.first()
        delete args[0]
        var string = args.join(' ')
        Embeds.error(toban, `You have been banned from ${msg.guild.name} by the user ${msg.author} with the reason ${string}`)
        setTimeout(function(){ 
            try {
            toban.ban(`was banned by ${msg.author} for: ${string}`)
            Embeds.kicked(msg.channel, `${toban} has been banned by ${msg.author} from the server with the following reason: ${string}`, `Banned User from the server`)
            } catch {
                Embeds.error(msg.channel, `I dont have permissions to ban ${toban} `, "Error")
            }
         }, 1000); 
    } else {
        const toban = msg.mentions.members.first()
        Embeds.error(msg.channel, `You dont have permissions to Ban ${toban} `, "Error")
    }
}
}

錯誤:

(node:13896) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
DICT_TYPE_CONVERT: Only dictionaries may be used in a DictType

推薦答案

這很容易解決,你所要做的就是以正確的方式將適量的參數傳遞給 .ban 功能.

this is pretty easy to solve, all you have to to is pass the right amount of Parameters in the right way to the .ban function.

.ban({ days: 7, reason: 'your reason here' })

https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=ban

這篇關于Discord.js 禁止命令中的無效表單正文的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 服務器時的歡迎消息)
主站蜘蛛池模板: 成人深夜福利网站 | 亚洲欧美日韩精品久久亚洲区 | 久久久www成人免费无遮挡大片 | 亚洲精品国产成人 | 久久亚洲二区 | 成年免费在线观看 | 国产精品国产三级国产aⅴ中文 | 成人黄色网址大全 | 色综合久久久久 | 99久久精品免费看国产高清 | 三级av网址 | 国产精品99久久久久久久vr | 中文字幕亚洲精品 | 国产精品一区二区在线观看 | 亚洲国产情侣自拍 | 国产天堂 | 中文字幕11页| 日一区二区 | 国产精品久久久一区二区三区 | 欧美综合在线视频 | 亚洲欧美日韩在线不卡 | 国产传媒视频在线观看 | 成人精品一区二区三区中文字幕 | 久草在线在线精品观看 | 久久国内精品 | 美女视频一区二区三区 | 久久精品综合网 | 日韩精品视频在线 | 欧美精品91| 中日韩av | www.亚洲精品 | 日韩精品一区二区三区在线观看 | 日批免费看 | 国产视频一区二区三区四区五区 | 国产免费让你躁在线视频 | 国产一区二区不卡 | 国产一级在线 | 亚洲男女视频在线观看 | 在线一区二区观看 | 免费人成在线观看网站 | 亚洲国产在 |