【问题标题】:Discord.js v12 How to make commands only work in a certain server?Discord.js v12 如何让命令只在特定服务器上运行?
【发布时间】:2020-10-14 18:02:04
【问题描述】:

我试图让一些“命令”只适用于特定的服务器,所以当在不同的服务器中使用时,它会说类似This command can only be used in [GUILD] server. 让我知道是否有人有任何解决方案。谢谢!

【问题讨论】:

    标签: javascript server command discord


    【解决方案1】:

    在执行你的命令功能之前,你可以检查一下:

    if (message.guild.id !== 'TheIdOfYourGuild') return message.reply('This command can only be used in another server.');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-30
      • 2021-01-01
      • 2021-02-18
      • 1970-01-01
      • 2021-01-18
      • 2021-04-14
      • 2021-04-19
      • 2021-04-18
      相关资源
      最近更新 更多