【发布时间】:2020-10-20 03:11:31
【问题描述】:
我编写了一个 Discord-bot,它回复收到的 dms 时会说“bruh dming me has just no point”。一个朋友给了我这个惊人的想法,从 r/copypasta 中提取答案。但我不知道该怎么做,所以我问。代码的重要部分:
client.on('message', message => {
if (message.channel.type === "dm" && message.author.id !== client.user.id) {
console.log("-----DM-----")
console.log(message.content)
console.log(message.author.tag)
console.log("-----DM-----")
message.author.send("bruh dming me has literally no point");
client.channels.cache.get('726919268142415973').send({
embed: {
color: 0x00baba,
author: {
name: "I recieved the following DM:",
icon_url: message.author.avatarURL
},
title: message.author.tag,
description: message.content,
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL,
text: "Staff"
}
}
});
}
});
【问题讨论】:
标签: javascript bots discord.js