Column01/Discord-Moderation-Bot

Storage explanation

ben2224 opened this issue · 2 comments

I'm not sure if this is active but if it is...

Can someone give a brief explanation of how the storage system works. I planned to have a storage system where different things are stored in different json files but this appears to all be in one and i'm not quite sure how this works/how to use it.

Thanks.

The storage system uses JSON, all guilds are stored in one file as this originally was meant to replace an existing single-server moderation bot.

All the code for the storage is done in storage_management.py. In there, it loads the settings file from disk (settings.json) and then it reads the JSON into a python dictionary. All further modification happens by first modifying the self.settings dictionary, and then it writes it to disk to save it. In order to split it into different files for different things, you could modify it to allow you to use self.load_settings(file_name) or something like that and then the self.settings variable will get loaded with that file (provided you also change it to use that file name in the loading code).

Please let me know if you have any other questions.

Gonna close this as I can't really give you much more info on the subject without writing a bunch of code, and this really isn't an issue with the bot