So in the context of APIs its knowledgable that they use json to pass to the user data like sort of payloads. But i want on 1 scenario to use json and kinda translate back and fourth from json to a embed, message.... etc.
Since i wanna work on a very powerful feature thats sort of channel snapshots where the bot gets the last 100 messages including pinned ones, serialises the data to json like embeds, components, files..... And when i lets say want to use a command called /snapshot recreate i can just pass in the json file the bot gave me. And it will create all messages sent with webhooks, attach the permissions and all other attributes which can deal with scenarios like nukes and hacked admins and ofc you can save snapshots manually by /snapshot save which gets the objects and converts them into json
The question is should i invent the wheel on how to transform the objects into json or is there a built in way to do so?
I thought of stuff like databases but it can be a memory issue when there are a lot of channels, lets hypothetically say i have 105 messages stored in each channel the 5 are pinned and 100 are newest. If i have a server where there are 35 channels and has the average said above. It would be 3675 records(not counting permissions, if the channel is stage, voice, announcement.....) for each server which might be a issue if i wanna make it public