pocin
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by pocin on 6/17/2024 in #djs-questions
is there a way to vertically pad non monospace text in an embed
2 replies
DIAdiscord.js - Imagine an app
•Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
discord.py has support for querying message history using timestamps (not only message ids) https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.history
I was looking for this feature in discord.js closest thing is https://discord.js.org/#%2Fdocs%2Fdiscord.js%2Fmain%2Fclass%2FMessageManager= but that accepts only snowflake.
channel.messages.fetch({ limit: 10, cache: false, after: '99539446449315840' })
Is there an official way or the hack-ish workaround would be encoding the timestamp into a dummy snowflake and use it to query the history?
i.e. if i want messages since 1658413979113
timestamp i do (1658413979113 - 1420070400000)<<22
?16 replies