#Result of the eval
1 messages · Page 1 of 1 (latest)
[
"2022-09-26T15:11:34.776Z",
"2022-09-26T15:11:20.670Z",
"2022-09-26T15:11:20.196Z",
"2022-09-26T15:07:54.047Z",
"2022-09-26T15:07:42.621Z",
"2022-09-26T15:06:58.148Z",
"2022-09-26T15:06:57.931Z",
"2022-09-24T14:36:23.899Z",
"2022-09-24T14:36:22.422Z",
"2022-09-24T14:34:26.058Z",
"2022-09-24T14:34:25.869Z",
"2022-09-24T14:08:09.443Z",
"2022-09-24T14:07:52.518Z",
"2022-09-24T14:07:52.394Z",
"2022-09-24T14:07:28.128Z",
"2022-09-24T14:07:28.005Z",
"2022-09-24T14:06:39.639Z",
"2022-09-24T14:06:33.172Z",
"2022-09-24T14:06:32.788Z",
"2022-09-22T02:36:59.677Z",
"2022-09-22T02:36:59.388Z",
"2022-09-22T02:36:59.099Z",
"2022-09-20T21:58:15.340Z",
"2022-09-20T21:57:39.387Z",
"2022-09-18T22:08:22.064Z",
"2022-09-18T22:08:21.954Z",
"2022-09-18T22:08:04.127Z",
"2022-09-18T22:08:03.803Z",
"2022-09-15T11:46:46.349Z",
"2022-09-15T11:46:44.874Z",
"2022-09-15T03:17:50.961Z",
"2022-09-15T03:17:21.888Z",
"2022-09-15T00:27:43.579Z",
"2022-09-15T00:27:41.942Z",
"2022-09-15T00:27:36.601Z",
"2022-09-15T00:27:34.638Z",
"2022-09-14T20:58:54.324Z",
"2022-09-14T20:58:52.553Z",
"2022-09-14T15:34:58.759Z",
"2022-09-14T15:34:51.334Z",
"2022-09-14T15:34:00.795Z",
"2022-09-14T15:33:58.652Z",
"2022-09-12T19:23:03.803Z",
"2022-09-12T19:22:24.407Z",
"2022-09-12T19:22:04.302Z",
"2022-09-12T19:22:03.676Z",
"2022-09-11T19:28:49.306Z",
"2022-09-11T19:28:49.032Z",
"2022-09-11T19:28:38.692Z",
"2022-09-11T19:23:55.012Z"
]```
i see i see
ahh
its the same for <MessageManager>.cache too right?
Hmm

[
"2022-09-26T15:06:57.931Z",
"2022-09-26T15:06:58.148Z",
"2022-09-26T15:07:42.621Z",
"2022-09-26T15:07:54.047Z",
"2022-09-26T15:11:20.196Z",
"2022-09-24T14:36:22.422Z",
"2022-09-24T14:36:23.899Z",
"2022-09-24T14:34:25.869Z",
"2022-09-24T14:34:26.058Z",
"2022-09-24T14:07:52.394Z",
"2022-09-24T14:08:09.443Z",
"2022-09-24T14:07:52.518Z",
"2022-09-24T14:07:28.005Z",
"2022-09-24T14:07:28.128Z",
"2022-09-24T14:06:32.788Z",
"2022-09-24T14:06:39.639Z",
"2022-09-24T14:06:33.172Z",
"2022-09-22T02:36:59.099Z",
"2022-09-22T02:36:59.677Z",
"2022-09-22T02:36:59.388Z",
"2022-09-20T21:58:15.340Z",
"2022-09-20T21:57:39.387Z",
"2022-09-18T22:08:21.954Z",
"2022-09-18T22:08:22.064Z",
"2022-09-18T22:08:03.803Z",
"2022-09-18T22:08:04.127Z",
"2022-09-15T11:46:46.349Z",
"2022-09-15T11:46:44.874Z",
"2022-09-15T03:17:50.961Z",
"2022-09-15T03:17:21.888Z",
"2022-09-15T00:27:43.579Z",
"2022-09-15T00:27:41.942Z",
"2022-09-15T00:27:36.601Z",
"2022-09-15T00:27:34.638Z",
"2022-09-14T20:58:54.324Z",
"2022-09-14T20:58:52.553Z",
"2022-09-14T15:34:58.759Z",
"2022-09-14T15:34:51.334Z",
"2022-09-14T15:34:00.795Z",
"2022-09-14T15:33:58.652Z",
"2022-09-12T19:23:03.803Z",
"2022-09-12T19:22:24.407Z",
"2022-09-12T19:22:03.676Z",
"2022-09-12T19:22:04.302Z",
"2022-09-11T19:28:49.306Z",
"2022-09-11T19:28:49.032Z",
"2022-09-11T19:28:38.692Z",
"2022-09-11T19:23:55.012Z",
"2022-09-11T19:23:40.661Z",
"2022-09-06T22:53:06.210Z",
"2022-09-06T22:53:06.416Z",
"2022-09-26T15:11:20.670Z",
"2022-09-26T15:11:34.776Z",
"2022-09-26T15:11:46.792Z",
"2022-09-26T15:11:48.635Z"
]```
Typeof: `object` | Class: `Array` | Time taken: `0.31301403045654297ms` | Discord.js version: `13.4.0` | Node version: `16.15.1` | Executed at: <t:1664207259:F>
.
No, it's unreliable
Use Collection.sort()
oh ok tyvm
this is the example given in the docs, ```ts
collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp);
I think djs has a native method to sort too
Documentation suggestion for @vagrant shoal:
discordSort
Sorts by Discord's position and id.
hm i want to sort from newer msg to older msg
Probably, wait a sec, let me eval again lol
ook
message.channel.messages.cache.map(c => c.createdTimestamp).sort((a,b) => a - b)
[
1662504786210,
1662504786416,
1662924220661,
1662924235012,
1662924518692,
1662924529032,
1662924529306,
1663010523676,
1663010524302,
1663010544407,
1663010583803,
1663169638652,
1663169640795,
1663169691334,
1663169698759,
1663189132553,
1663189134324,
1663201654638,
1663201656601,
1663201661942,
1663201663579,
1663211841888,
1663211870961,
1663242404874,
1663242406349,
1663538883803,
1663538884127,
1663538901954,
1663538902064,
1663711059387,
1663711095340,
1663814219099,
1663814219388,
1663814219677,
1664028392788,
1664028393172,
1664028399639,
1664028448005,
1664028448128,
1664028472394,
1664028472518,
1664028489443,
1664030065869,
1664030066058,
1664030182422,
1664030183899,
1664204817931,
1664204818148,
1664204862621,
1664204874047,
1664205080196,
1664205080670,
1664205094776,
1664205106792,
1664205108635,
1664207259225,
1664207260610,
1664208105046
]```
Sorts older to newer
ty
and then from newer to older would be message.channel.messages.cache.map(c => c.createdTimestamp).sort((a,b) => b - a)
b - a
I think so