if (message.content.startsWith("-send")) {
if (message.author.id === '405714654065721344') {
var text = message.content.substring(6)
db.serialize();
db.all(`SELECT log_channel FROM log_value`, function (err, rows) {
if (!err) {
rows.forEach(function (row) {
message.channel.send(row.log_channel)
let channel_id = row.log_channel;
console.log(channel_id)
parseInt(channel_id)
try {
bot.channels.get(`'${channel_id}`).send(text)
} catch (err) {
console.log(err)
}
});
} else {
console.log(err)
}
})
} else {
return error.noPerms(message, "BOT DEVELOPS", message.author.username)
}
}
I want my bot (public) can sendMessage in specific channel. but I have an error.
error: cannot read property 'send' of undefined