diff --git a/edmond/plugin.py b/edmond/plugin.py index 2c01b0d..92c06d6 100644 --- a/edmond/plugin.py +++ b/edmond/plugin.py @@ -105,12 +105,13 @@ class Plugin: ns = self.name return self.bot.storage.get(ns, {}).get(key, default) - def set_storage_value(self, key, value): + def set_storage_value(self, key, value, ns=None): """Set a value in the plugin persistent storage.""" - if self.name not in self.bot.storage: - self.bot.storage[self.name] = {key: value} + name = ns or self.name + if name not in self.bot.storage: + self.bot.storage[name] = {key: value} else: - self.bot.storage[self.name][key] = value + self.bot.storage[name][key] = value def append_storage_list_value(self, key, value): """Append a value to a list in the plugin persistent storage."""