IcyPickle
IcyPickle
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
😢
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
is there any better way to do this?
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
it just takes a long time to finish
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
nvm got it working
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
const streak = await (async () => {
const timestamp = SnowflakeUtil.generate(Date.now() - (1000 * 60 * 60 * 24));
let msgCountInGuild = 0;
for (const chnl of message.guild.channels.cache.filter((chnl) => {chnl.type === ChannelType.GuildText}).values()) msgCountInGuild += ((await chnl.messages.fetch({after: timestamp.toString()}))
.filter((msg) =>
msg.author.id === user.id).size
)
console.log(msgCountInGuild);
return Math.floor(msgCountInGuild / 50);
})()
const streak = await (async () => {
const timestamp = SnowflakeUtil.generate(Date.now() - (1000 * 60 * 60 * 24));
let msgCountInGuild = 0;
for (const chnl of message.guild.channels.cache.filter((chnl) => {chnl.type === ChannelType.GuildText}).values()) msgCountInGuild += ((await chnl.messages.fetch({after: timestamp.toString()}))
.filter((msg) =>
msg.author.id === user.id).size
)
console.log(msgCountInGuild);
return Math.floor(msgCountInGuild / 50);
})()
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
no errors but msgCountInGuild is always 0
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
worked and didn't work
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
oh
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
No description
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
except user.id which is
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
nothing from outside is mentioned
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
just this
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
const timestamp = SnowflakeUtil.generate(Date.now() - (1000 * 60 * 60 * 24));
let msgCountInGuild = 0;
for (const chnl of await message.guild.channels.cache.values()) msgCountInGuild += ((await chnl.messages.fetch({after: timestamp.toString()}))
.filter((msg) =>
msg.author.id === user.id).size
^^
const timestamp = SnowflakeUtil.generate(Date.now() - (1000 * 60 * 60 * 24));
let msgCountInGuild = 0;
for (const chnl of await message.guild.channels.cache.values()) msgCountInGuild += ((await chnl.messages.fetch({after: timestamp.toString()}))
.filter((msg) =>
msg.author.id === user.id).size
^^
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
it's a seperate function it doesn't have any linkage to the rest of the code
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
no i'm getting the count of all messages in the last 24 hours, dividing it by 50 then creating a msg streak stat
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
No description
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
No description
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
^
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
No description
52 replies
DIAdiscord.js - Imagine a bot
Created by IcyPickle on 7/1/2024 in #djs-questions
how do you fetch all messages created after a specific date?
fetch is still undefined
52 replies