I'm a discord bot developer and I use an SQLite database for my bot. I installed sqlite3
by npm command and I worked with it, there was no problem, but now I can't use it because it modifies values. I have a bit of code here:
const ghostChannels = await new Promise((resolve, reject) =>
client.db.all(`SELECT * FROM "Ghosts"`, (err, rows) =>
err ? reject(err) : resolve(rows)
)
);
ghostChannels.forEach(async (channel) => {
const guildchannel = await message.member.guild.channels.cache.get(
channel.id
);
console.log(channel.id);
console.log(guildchannel);
const mess = await guildchannel.send(message.member);
await mess.delete();
});
Unfortunately it returns an error:
Uncaught TypeError TypeError: channel.send is not a function
So I looked at the id
, and saw that it's not the same ID as in the database:
I don't know how to fix it, so if someone knows, tell me :)