【发布时间】:2021-11-24 02:42:08
【问题描述】:
我不明白为什么我的消息没有发送给所有决定接收通知的用户。它只发送给一个。如果有任何关于 quick.db 的文件可以修复它,当然让我知道。
这是 notify.js 代码
module.exports = {
name: 'notify',
description: 'Notify people when a new update is released',
category: "Notified",
execute(client, message, args, Discord) {
if(message.member.user.id === '601364286731714591'){
const db = require('quick.db')
let notification = db.get(`notifiedusers_${message.author.id}`);
if(notification === null) {
return message.channel.send('Nobody is notified for any updates')
}
const content = args.join(" ")
if(!content) return message.channel.send('What would be the content of the Update Be ?')
const newEmbed = new Discord.MessageEmbed()
.setColor('#b5b5b5')
.setTitle('Update')
.setDescription(`${content}`)
message.channel.send('Notifying everybody that desiced to be notified')
try{
const chx = client.users.cache.get(notification)
chx.send({embeds: [newEmbed]})
}finally{
message.channel.send('Everybody was notified')
}
}else{
return
}
}
}
【问题讨论】:
标签: javascript database discord discord.js