mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-06-08 11:22:14 +03:00
Update database specifications and storage in the object
This commit is contained in:
parent
2ee1f6550b
commit
8112e5eda4
@ -16,7 +16,7 @@
|
|||||||
* <discord user id>, ...
|
* <discord user id>, ...
|
||||||
* ],
|
* ],
|
||||||
*
|
*
|
||||||
* server: [
|
* servers: [
|
||||||
* {
|
* {
|
||||||
* name: <server name>,
|
* name: <server name>,
|
||||||
* type: <"SERVER"|"DM">
|
* type: <"SERVER"|"DM">
|
||||||
@ -25,7 +25,7 @@
|
|||||||
*
|
*
|
||||||
* channels: {
|
* channels: {
|
||||||
* <discord channel id>: {
|
* <discord channel id>: {
|
||||||
* server: <server index in the metadata.server array>,
|
* server: <server index in the meta.servers array>,
|
||||||
* name: <channel name>
|
* name: <channel name>
|
||||||
* }, ...
|
* }, ...
|
||||||
* }
|
* }
|
||||||
@ -53,14 +53,35 @@
|
|||||||
* }, ...
|
* }, ...
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* TEMPORARY OBJECT STRUCTURE
|
||||||
|
* ==========================
|
||||||
|
*
|
||||||
|
* {
|
||||||
|
* userlookup: {
|
||||||
|
* <discord user id>: <user index in the meta.userindex array>
|
||||||
|
* }
|
||||||
|
* }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var SAVEFILE = function(){
|
var SAVEFILE = function(){
|
||||||
this.db = {};
|
this.meta = {};
|
||||||
this.db.meta = {};
|
this.meta.users = {};
|
||||||
this.db.data = {};
|
this.meta.userindex = [];
|
||||||
|
this.meta.servers = [];
|
||||||
|
this.meta.channels = {};
|
||||||
|
|
||||||
|
this.data = {};
|
||||||
|
|
||||||
|
this.tmp = {};
|
||||||
|
this.tmp.userlookup = {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
SAVEFILE.prototype.toJson = function(){
|
SAVEFILE.prototype.toJson = function(){
|
||||||
return JSON.stringify(this.db);
|
return JSON.stringify({
|
||||||
|
meta: this.meta,
|
||||||
|
data: this.data
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user