【问题标题】:How can I check if the message author has guild ownership using Discord.js?如何使用 Discord.js 检查消息作者是否拥有公会所有权?
【发布时间】:2020-11-19 02:58:19
【问题描述】:

我正在创建一个备份机器人,我不希望人们有权制作或加载备份,除非他们是公会所有者

我现在正在使用它。

 if(!message.member.hasPermission("ADMINISTRATOR")){
            return message.channel.send(":x: | You must be an administrator of this server to request a backup!");
        }

【问题讨论】:

    标签: node.js discord discord.js


    【解决方案1】:
    if (message.guild.ownerID !== message.author.id) return message.channel.send(`You must be the owner of this server.`);
    

    【讨论】:

    • 非常感谢!
    猜你喜欢
    • 2019-11-17
    • 2020-12-10
    • 2021-09-26
    • 2019-11-23
    • 2020-08-25
    • 1970-01-01
    • 2021-04-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多