|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Plugin:
|
|
|
|
@ -25,6 +26,12 @@ class Plugin:
|
|
|
|
|
plugins_configs = self.bot.config["plugins"]
|
|
|
|
|
config = plugins_configs["common"].copy()
|
|
|
|
|
config.update(plugins_configs.get(self.name, {}))
|
|
|
|
|
# Load resources as config values.
|
|
|
|
|
resources_dir = self.bot.config["resources_dir"]
|
|
|
|
|
for key, resource_path in config.get("resources", {}).items():
|
|
|
|
|
resource_path = Path(resources_dir) / resource_path
|
|
|
|
|
with open(resource_path, "rt") as resource_file:
|
|
|
|
|
config[key] = [l.strip() for l in resource_file.readlines()]
|
|
|
|
|
return config
|
|
|
|
|
|
|
|
|
|
def check_config(self):
|
|
|
|
|