Sourceb in code: https://sourceb.in/AVT0a4WmgL , I need sleep I'm going to bed bye need help :)
#It gives this error
50 messages · Page 1 of 1 (latest)
Younare missing the second parameter of the method from quick.db
When using set for example. You need the id as first parameter and the second parameter is the value
You are missing the second one. Missing means it's either not passed in the method or it's undefined
I am using MongoDB but
I looked at the code but I didn't quite understand what you said.
The use of Mongodb doesn't change anything here.
I said that you are missing an argument
db.set("<id>"); // missing second argument
const value = undefined;
db.set("<id>", value); // still missing second argument
The second argument cannot be unrefined and is required
jsdb.set("<id>");
``` instead of typing
```js
const value = undefined;
db.set("<id>", value);
So should I write this?
No, they are both wrong
Both are missing the second argument
Set needs two arguments
And the second argument cannot be undefined
Set will set a value for that specific id
It needs the id and the value
await db.set("test", 1);
console.log(await db.get("test")); // 1
That is the correct usage of db set
I looked at the code thoroughly, but I couldn't see the db.set command, how do i add it or do i need to add*?
Which error are you getting then? Your screenshot of the error shows 2 error
Ah I ses what is happening
You catch the error bug log it so you get an other error after that
I don't think there is anything wrong with that.
const mongoose = require("mongoose")
module.exports = mongoose.model("System", new mongoose.Schema({
kanal: String,
sunucu: String,
status: String,
channel: String
}))
Let me take a see at main.js
I never said there was something wrong with this
But you are using mongoose and quick.db? That makes no sense
I installed the Quick.db module but I don't remember using it
https://sourceb.in/66aRKxkSPkI
think the db.set* thing you mentioned is here
You do use it
Let's get to the first error first since this one I know where it is
Since the second error that crashes your bot is cut off
The 2nd error makes the bot completely offline, very frustrating
That is normal. The first error you try catch it. It would make your bot crash too but you handled it...
The question is. Do you want to fix the first error or not? You already try catch it
The first error doesn't turn off the bot or break the command, I don't think it's necessary to fix it
Sure, it doesn't because you try catch it.
Let's get to the second error. The other source bin link you sent is invalid.
You also cut the second error from the screenshot so I can't tell you in which file it is. You will need to find it. That error is because you are missing the second parameter of a quick.db method
oh wait
sorry
sorry
I accidentally deleted the letter L
Do you think I should pull the db module from quick.db to mongoose?
No worries.
If that is really the file where the second error happen. Then it's probably because of line 44
await db.set(`sondeprem`, ayn.timestamp);
This is bad.
You use set with the first and second parameter but you never checked if ayn.timestamp is defined
You only check if it's equal to an other value. Which that value can also be undefined
so how do i use it as 1 different parameters? i don't know because 
You should check if ayn.timestamp is defined and only use it when it is. You need to do the rest, I don't know what you want to do if it's undefined
if(ayn.timestamp) {
// ayn.timestamp is defined
} else {
// ayn.timestamp is not defined
}```
I'm going to paste it above line 44 and fix it, right?