简体   繁体   English

如何阻止@everyone 和@here 的使用? 使用 discord.js

[英]How do I block the use of @everyone and @here? with discord.js

我想让我的机器人阻止@everyone 和@here 并发送一条“你需要管理员角色才能做到这一点”消息,但仍然允许某些角色使用@everyone 和@here

Your bot can only catch messages after they send - this means everyone would still get an annoying ping from the person using @everyone, then the message would go away.您的机器人只能在发送消息后捕获消息 - 这意味着每个人仍然会从使用@everyone 的人那里收到烦人的 ping,然后消息就会消失。 Only a half measure.只测量了一半。

Restricting @everyone/@here to certain roles is possible in normal Discord (since this tutorial was created, the role permission was changed to "Mention @everyone, @here and All Roles").在普通的 Discord 中可以将@everyone/@here 限制为某些角色(由于创建了本教程,角色权限已更改为“提及@everyone、@here 和所有角色”)。
When you've done this and someone types @everyone, it will be treated like any other message.当您完成此操作并且有人输入@everyone 时,它​​将被视为任何其他消息。 Here's an an image of my testing: Notice only one of the messages has the gold highlight: that was the time the account had the permission to send @everyone messages.这是我的测试图像:请注意,只有一条消息具有金色突出显示:那是该帐户有权发送@everyone 消息的时间。

不一样的@everyone

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM