From 84bba77f46bcb9eb3dc937d9d7fdc53d59f87be1 Mon Sep 17 00:00:00 2001 From: granny Date: Tue, 12 Jan 2021 04:57:49 -0800 Subject: [PATCH] fix up plugin loop code --- cogs/timings.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cogs/timings.py b/cogs/timings.py index b234d16..7af513f 100644 --- a/cogs/timings.py +++ b/cogs/timings.py @@ -185,14 +185,14 @@ class Timings(commands.Cog): try: plugins = r["timingsMaster"]["plugins"] if not YAML_ERROR: - for plugin in plugins: - for stored_plugin in TIMINGS_CHECK["plugins"]["paper"]: - if plugin == stored_plugin["name"]: - embed_var.add_field(**create_field(stored_plugin)) - if "purpur" in r["timingsMaster"]["config"] and "purpur" in TIMINGS_CHECK["plugins"]: - for stored_plugin in TIMINGS_CHECK["plugins"]["purpur"]: - if plugin == stored_plugin["name"]: - embed_var.add_field(**create_field(stored_plugin)) + for server_name in TIMINGS_CHECK["plugins"]: + if server_name in r["timingsMaster"]["config"]: + for plugin in plugins: + for plugin_name in TIMINGS_CHECK["plugins"][server_name]: + if plugin == plugin_name: + stored_plugin = TIMINGS_CHECK["plugins"][server_name][plugin_name] + stored_plugin["name"] = plugin_name + embed_var.add_field(**create_field(stored_plugin)) else: embed_var.add_field(name="Error loading YAML file", value=YAML_ERROR)