pocin
pocin
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
great, thanks a ton!
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
okay that makes sense. I will fetch 100 at a time and paginate. From your experience if i plan to process multiple channels (potentially all in a guild). Does it make sense to process them in paralell or i would get rate limited even downloading messages from one channel at a time?
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
const messages = await channel.messages.fetch({
cache: false, // do not cache
after: dummyId
})
const messages = await channel.messages.fetch({
cache: false, // do not cache
after: dummyId
})
yields a collection of messages. Do i have to paginate myself so i dont store all messages in memory or is there something already implemented?
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
one more thing
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
thank you very much!
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
ah right so .toString()
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
$node
> const djs = require('discord.js')
> djs.SnowflakeUtil.generate({timestamp: 1658413979113})
999685427247976448n
$node
> const djs = require('discord.js')
> djs.SnowflakeUtil.generate({timestamp: 1658413979113})
999685427247976448n
safe to use? Looks like it's formatted as a number (isnt there the overflow issue?)
16 replies
DIAdiscord.js - Imagine an app
Created by pocin on 7/21/2022 in #djs-questions
Using timestamp to fetch messages history
amazing, thanks a lot!
16 replies