Browse Source

Timings - Find bad datapacks

pull/16/head
DrBot7 3 years ago
parent
commit
281af6bc3d
  1. 11
      cogs/timings_public.py

11
cogs/timings_public.py

@ -168,10 +168,13 @@ class Timings(commands.Cog):
try:
datapacks = request_raw["datapacks"]
if len(datapacks) > 2:
datapack_count = len(datapacks) - 2
embed_var.add_field(name="❌ Datapacks",
value=f"You have {datapack_count} datapack(s). To see if they are causing lag, unzip them and look for a folder called functions. If the folder exists, remove the datapack.")
handlers = request_raw["idmap"]["handlers"]
for handler in handlers:
handler_name = request_raw["idmap"]["handlers"][handler][1]
if handler_name.startswith("Command Function - ") and handler_name.endswith(":tick"):
handler_name = handler_name.split("Command Function - ")[1].split(":tick")[0]
embed_var.add_field(name=f"{handler_name}",
value=f"This datapack uses command functions which are laggy.")
except KeyError as key:
print("Missing: " + str(key))

Loading…
Cancel
Save