简体   繁体   English

discord.js bot问题:如何用角色集合替换所有者的ID

[英]discord.js bot problem: how can replace owner's id with roles collection

i was trying to create a warning about pinging staff, my current code is:我试图创建一个关于 ping 员工的警告,我当前的代码是:

const ownerId = "ID";

    client.on("message", async message => {
    if (message.author.bot) return false;

    if (message.mentions.has(ownerId)) {
        await message.delete();
        message.reply(`dont ping it!`);
    };
});

client.login(process.env.DISCORD_AUTH_TOKEN);

i was trying to create a warning about pinging staff, my current code is:我试图创建一个关于 ping 员工的警告,我当前的代码是:

const ownerId = "ID";

    client.on("message", async message => {
    if (message.author.bot) return false;

    if (message.mentions.has(ownerId)) {
        await message.delete();
        message.reply(`dont ping it!`);
    };
});

client.login(process.env.DISCORD_AUTH_TOKEN);

i was trying to create a warning about pinging staff, my current code is:我试图创建一个关于 ping 员工的警告,我当前的代码是:

const ownerId = "ID";

    client.on("message", async message => {
    if (message.author.bot) return false;

    if (message.mentions.has(ownerId)) {
        await message.delete();
        message.reply(`dont ping it!`);
    };
});

client.login(process.env.DISCORD_AUTH_TOKEN);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Discord.js | 如何让机器人不带前缀地回复特定 ID 消息的所有者 - Discord.js | How to make bot reply to the owner of a specific ID's messages without prefix discord.js - 如何获取机器人语音频道的名称/ID - discord.js - How to get the name/id of the bot's voiceChannel Discord.js 问题id 会员发不出去是不是bot 不然 - Discord.js problem id member can't sent if is it bot or else 如何列出我的机器人在控制台中的所有 Discord 服务器 ID? | discord.js - How can I list the all Discord servers ID where my bot are in the console? | discord.js Discord.js仅使用ID管理角色 - Discord.js manage roles with only id 如何更换 <br> 和 </br> 在discord.js bot上有一个新行吗? - How to replace <br> and </br> with a new line on discord.js bot? 如何修复无效位域 discord.js 机器人崩溃问题 - how to fix the Invalid Bitfield discord.js bot crash Problem 如何在 bot.on(&#39;ready&#39;, () =&gt; { }) 函数内的 discord.js 中获取频道 ID - How can I get a channel id in discord.js inside of the bot.on('ready', () => { }) function Discord.js:如何通过 Discord 用户 ID 查找服务器成员(在 Discord 中分配角色)? - Discord.js: How to find server member (to assign roles in Discord) by Discord User-ID? 如何在 discord.js v12 中捕获错误并将其发送给机器人所有者? - How do you catch an error and send it to the bot owner in discord.js v12?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM