简体   繁体   English

如何在不使用带有 discord.js 的 bulkDelete() 的情况下清除超过 14 天的消息?

[英]How do I purge messages more than 14 days old without using bulkDelete() with discord.js?

I want to make a bot that deletes messages older than an amount specified.我想制作一个机器人来删除早于指定数量的消息。 I know it will be slow but bulkDelete() has the stipulation of only allowing you to delete messages younger than 14 days.我知道它会很慢,但是 bulkDelete() 规定只允许您删除 14 天以内的消息。 I want to circumvent this by deleting one at a time.我想通过一次删除一个来避免这种情况。 How would I do this?我该怎么做?

I tried doing bulkDelete() but that does not work.我尝试执行 bulkDelete() 但这不起作用。 How do I do it with only the delete command?我如何仅使用删除命令来执行此操作?

You can't delete messages older than 14 days.您不能删除超过 14 天的消息。 It is not allowed by Discord Discord Developer Portal - Documentation - Channel This endpoint will not delete messages older than 2 weeks, and will fail with a 400 BAD REQUEST if any message provided is older than that or if any duplicate message IDs are provided. Discord Discord 开发人员门户 - 文档 - 频道不允许This endpoint will not delete messages older than 2 weeks, and will fail with a 400 BAD REQUEST if any message provided is older than that or if any duplicate message IDs are provided.

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

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