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

如何使用突擊隊框架在 discord.js 禁止和踢命令中

how to add reason in discord.js ban and kick command with commando framework?(如何使用突擊隊框架在 discord.js 禁止和踢命令中添加原因?)
本文介紹了如何使用突擊隊框架在 discord.js 禁止和踢命令中添加原因?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我目前正在開發一個帶有 commando 的 discord.js 機器人(這是 discord.js 創建者的官方框架/命令處理程序)
我在各種網站上研究過這個主題,但我的突擊隊框架似乎沒有任何效果.
這是代碼

I'm currently working on a discord.js bot with commando (which is the official framework/commands handler from the discord.js creator)
I have researched this subject on various websites and nothing seems to work with my commando framework.
This is the code

const Commando = require("discord.js-commando");

module.exports = class banCommands extends (
  Commando.Command
) {
  constructor(client) {
    super(client, {
      name: "ban",
      aliases: ["bans"],
      group: "general",
      memberName: "ban",
      description: "Banned the mention member from the server",
    });
  }
  run(message) {
    const target = message.mentions.users.first();
    if (!target) {
      message.reply("you need to have at least one users mentioned");
      return;
    }
    const { guild } = message;
    const member = guild.members.cache.get(target.id);
    if (member.bannable) {
      guild.members.ban(member);
      message.reply("That user has been banned");
    } else {
      message.reply("You cannot ban that user.");
      console.log(target);
    }
  }
};

有什么建議嗎?或任何具有相同主題的東西?

Any suggestion? or anything that have the same subject?

謝謝

推薦答案

您需要將它放在 options 參數中(參見 docs).您也應該使用 member.ban 而不是 guild.members.ban(member),但無論如何,這里有一個例子:

You'll need to put it in the options argument (see the docs). You should also probably use member.ban instead of guild.members.ban(member), but anyways, here's an example:

member.ban({
    reason: "Your reason here"
});

并且該成員將被禁止,審核日志中的推理會正確顯示.您還應該在命令中添加 reason 參數.不要問我怎么回事,我已經有一年沒有接觸過 discord.js 了,尤其是突擊隊.檢查指南.提及第一個論點,然后提及原因.

And the member will be banned, with the reasoning in audit logs showing up properly. You should add an reason argument to your command as well. Don't ask me how though, I haven't touched discord.js in a year and especially not commando. Check the guide for that. Make the mention the first argument and the reason the rest.

這篇關于如何使用突擊隊框架在 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 服務器時的歡迎消息)
主站蜘蛛池模板: 国产一区在线免费观看视频 | 亚洲成人精品国产 | 婷婷毛片 | 久久一二区 | 久久神马 | 日本黄色一级片视频 | 国产精华一区 | 岛国av一区二区 | 在线免费观看毛片 | 亚洲国产成人久久久 | 成人伊人 | 久久精品视频免费观看 | 毛片免费观看 | 久久9视频 | 黄色一级在线播放 | 国产欧美一区二区三区在线看 | 久久久久久久久久久久一区二区 | 午夜日韩精品 | 久久久国产一区二区 | 毛片一级网站 | 一久久久| 欧美日产国产成人免费图片 | 国产日韩在线观看一区 | 精品99爱视频在线观看 | 久精品久久 | 亚洲免费久久久 | av在线一区二区三区 | 雨宫琴音一区二区在线 | 国产成人精品一区二区三区在线 | 一级毛片中国 | 国产精品毛片 | 超级碰在线 | 久久午夜电影 | 欧美高清视频 | 久久久xx| 福利视频日韩 | 国产精品18hdxxxⅹ在线 | 精品99在线 | 请别相信他免费喜剧电影在线观看 | 第一av| 午夜精品91 |