I was trying to save guild id and channel id using one command, using lowdb but I when I'm using var server = client.guilds.get(message.guild.id).id; I get error that says, Cannot read property 'get' of undefined. And I don't know why.
var server = client.guilds.get(message.guild.id).id;
var channel = client.guilds.get(message.channel.id).id;
db.get('posts')
.push({ id: server, title: channel})
.write();
There's all code I made, and I define everything on start of code
const client = require('<there's path but I don't want to show it cuz there's my name>/my_bot.js');
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('db.json')
const db = low(adapter)
If you know what's wrong please help