31 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Can you further explain your question?
When i type this command my bot respond this :
I want the sanctions (notes / warns / bans) are shuffled and sorted by date
actually my bot send me : notes (sorted by date) then warns (sorted by date) and then bans (sorted by date)
U have an idea ? thank's ! 🙂
my database is like this :
what you're telling me is that I should put everything in the same table ?
As they said, merging your data* would allow you to shuffle and sort by date
It doesn't necessarily have to be in one table
how to merging my data, if their on different tables ?
You can get all the data from your database and extract it to an array which can then be sorted by date
Instead of mapping through each table manually
How i do this ? 😐
You can spread
...
each tables data into your array.
Example:
Then you can sort that array by time using the sort method
It's less messy since they'd be able to keep their tables intact and can track them in an organised matterYes it's sure
But that's just what I recommend, you can choose what method you want for this and I hope you can achieve it. The result should be the same either way
yes the result will be the same, only putting everything back in a single table will be long (I have some mdoeration data)
i want to try this
Im here
how do you think i should do ?
Now you can sort that array by time then map through it to create your fields assuming they have similar properties
like this ?
Can you show me how an example of each can look like on a database?
@snokxx I'd like to suggest another way of going through this as you don't see to fully understand the past method
Ok ^^
How about doing the same thing but with for loops and adding a type property for the embed, example:
Obviously these aren't all the properties but just an example
Then you can:
ok i begin to understand
i try to buildthis on my code
Great, then you can:
Loop through the sanctions and put them on the fields successfully
Instead of looping through each table individually
Have you got any issues with that?
i fix some issues
the bot crash
I think it's good, finally it's functional
thank u
so much
No worries, lock this thread once you're done!
I just have to aesthetically change 2-3 things
u are the best
thank u men ! 🙂