Discord-Scraper icon indicating copy to clipboard operation
Discord-Scraper copied to clipboard

Not limiting messages to today's 24 hour window

Open brianwarehime opened this issue 4 years ago • 2 comments

When running the script for the first time in a channel, I notice that it's attempting to capture all the messages, and not just from the 24 hours of today (which is what I understand the code to be trying to do). When running it will capture messages from days prior to today, so just seeing if that's expected, and if so, how do I limit it to just today?

Another question too - is there a way to limit messages to after a specific message ID? I noticed in the API documentation you can supply a query string parameter of after to only show messages after that ID, but when adding that to the URL's in the code, it doesn't seem to recognize them.

Any help would be appreciated!

brianwarehime avatar Aug 10 '20 14:08 brianwarehime

So far I haven't yet figured out why the code is able to grab all of the JSON data but isn't capable of extrapolating all of the contents from said JSON data.

Embedded content is by far the trickiest since it links to other sites that don't adhere to the same design principles as Discord's own site (meaning that I'd have to write a separate scraper/module for every site that is to be scraped by the script similar to youtube-dl which supports a ton of sites other than YouTube).

As far as limiting messages to a particular member, that is very doable since the script has to make use of the undocumented API features for Discord's search in order to grab entire channels since the documented API limits us to 100 messages per channel at most: https://discord.com/developers/docs/resources/channel#get-channel-messages

I feel as if this whole repo requires a code-rewrite which would make this the 3rd to 4th time in almost 3 years. This time around I really have to fragment things in order to make them easier to maintain and not just easier to read.

Dracovian avatar Aug 10 '20 15:08 Dracovian

while day > datetime(2015, 1, 1): day = startGuild(scraper, guild, channel, day)

=>

startGuild(scraper, guild, channel, day)

pablonosh avatar Jul 07 '21 20:07 pablonosh