def get_json(key:, network: nil, channel: nil, nick: nil, default: nil, store: RabbotDb)
value = store.get_plugin_json(
plugin: PLUGIN,
key: key,
network: network,
channel: channel,
nick: nick,
default: nil
)
return value unless value.nil?
legacy = store.get_plugin_json(
plugin: LEGACY_PLUGIN,
key: key,
network: network,
channel: channel,
nick: nick,
default: nil
)
return default if legacy.nil?
set_json(
key: key,
value: legacy,
network: network,
channel: channel,
nick: nick,
store: store
)
legacy
end