GuildStorageLoader

new GuildStorageLoader()

Handles loading all guild-specific data from persistent storage into GuildStorage objects

Methods

.cleanGuilds(dataStorage: LocalStorage, settingsStorage: LocalStorage)

Clean out any storages/settings storages for guilds the bot is no longer a part of
Parameters:
Name Type Description
dataStorage
LocalStorage
LocalStorage instance containing all guild-specific data
settingsStorage
LocalStorage
LocalStorage instance containing all guild-specific settings

.initNewGuilds(dataStorage: LocalStorage, settingsStorage: LocalStorage)

Assign a GuildStorage to guilds that lack one due to the bot being in the guild before adopting this storage spec or the bot being added to a new guild
Parameters:
Name Type Description
dataStorage
LocalStorage
LocalStorage instance containing all guild-specific data
settingsStorage
LocalStorage
LocalStorage instance containing all guild-specific settings

.loadStorages(dataStorage: LocalStorage, settingsStorage: LocalStorage)

Load data for each guild from persistent storage and store it in a GuildStorage object
Parameters:
Name Type Description
dataStorage
LocalStorage
LocalStorage instance containing all guild-specific data
settingsStorage
LocalStorage
LocalStorage instance containing all guild-specific settings