Gửi tin nhắn trực tiếp cho người dùng thay vì kênh
Dec 31 2020
Vì vậy, tôi đã cố gắng tìm cách gửi bản nhúng này tới dms của người dùng thay vì một kênh, nhưng tất cả các bài đăng tôi tìm thấy đều không liên quan đến câu hỏi của tôi hoặc đã lỗi thời và không hoạt động chút nào.
module.exports = {
name: 'help',
description: 'this is a help command!',
execute(message, args){
const embed = new Discord.MessageEmbed()
.setTitle('List of Commands')
.setDescription('This embed lists all of my commands.')
.setColor('#ed2626')
.addFields({
name: '+help',
value: 'Shows a list of commands',
inline: true
}, {
name: '+ping',
value: 'Show your insolence to krennic!',
inline: true
}, {
name: 'Test Number 3',
value: 'This is a example value'
}, {
name: 'Test Number 4',
value: 'This is a example value'
})
.setTimestamp();
// This right here is what i'm trying to figure out
// Instead of sending in the channel how would i dm the person that calls the command?
message.channel.send(embed);
console.log('Help command was ran!')
}
}
Trả lời
1 strafexz Dec 31 2020 at 04:21
Bạn có thể gửi DM cho người dùng bằng User#send()
ví dụ phương pháp :
superCoolUserOmg.send(superCoolEmbedOmg)
CIA Dec 31 2020 at 00:51
Shoejep đã trả lời điều này
message.author.send(embed);