Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Accessing previous chat messages via the API?

Hi, simple question. Is it possible to access past chat messages with the API? I know how to listen for chat events live, but I'm curious if the API can look into the past either by accessing some attribute (the DOM, etc) or if i can somehow "replay" the event stream in a loop. Thanks! If you're curious WHY I want to do this: I've previously made a parser that can read the HTML chat logs and compute the average rolls, but the HTML is quite a large file (4MB+) and includes a lot of unnecessary text, it would save a lot of space if I could crunch the numbers on the JS side. I doubt it, but I figured I'd double check this avenue before getting into HTML space saving shenanigans
1658448261

Edited 1658448376
David M.
Pro
API Scripter
Will the RollStats script work for you? EDIT - optionally, you may be able to modify Oosh's UnWhisper script to capture all chat entries, though I don't know at what point it becomes untenable.  
1658458896
The Aaron
Roll20 Production Team
API Scripter
Mod scripts don't have access to any chat messages except the ones that occur while it is running.  You'd have to take statistics from chat messages going forward, but you could store all your counts in the state object so you could persist the gathering across executions of the script.