Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

javascript - Discord JS:如何删除漫游器在DM中发送的所有消息?(Discord JS: How do I delete all messages the bot has sent in DM's?)

I'm trying to make my bot delete all DM's from a user ID.(我试图让我的机器人从用户ID中删除所有DM。)

How would I get about doing this?(我将如何做呢?) I have tried using the DMchannel function but I am struggling.(我已经尝试使用DMchannel函数,但是我很挣扎。) The following code is what I have tried(以下代码是我尝试过的)
const dmCount = client.users.get("508625644792446986").dmChannel
var fetched =  dmCount.fetchMessages({limit: 99});
dmCount.bulkDelete(fetched)

I don't see what I'm doing wrong here, any suggestions on how to fix this?(我在这里看不到我在做什么错,关于如何解决此问题的任何建议?)

The error is:(错误是:)
TypeError: Cannot read property 'fetchMessages' of null
  ask by Surve translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...