From c2fcd4c30587b50db878ec2a5c47412cfd492b64 Mon Sep 17 00:00:00 2001 From: DrBot7 <46543473+DrBot7@users.noreply.github.com> Date: Mon, 11 Jan 2021 00:56:43 -0600 Subject: [PATCH] Update timings.py --- cogs/timings.py | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/cogs/timings.py b/cogs/timings.py index 4f0c426..e88de22 100644 --- a/cogs/timings.py +++ b/cogs/timings.py @@ -2,7 +2,6 @@ import discord from discord.ext import commands import requests - class Timings(commands.Cog): def __init__(self, bot): @@ -24,7 +23,7 @@ class Timings(commands.Cog): embed_var.add_field(name="❌ Spigot", value="Upgrade to [Purpur](https://ci.pl3x.net/job/Purpur/).", inline=True) - await message.channel.send(embed=embed_var) + await message.reply(embed=embed_var) return if timings_url == "": return @@ -41,7 +40,7 @@ class Timings(commands.Cog): embed_var.add_field(name="❌ Invalid report", value="Create a new timings report.", inline=True) - await message.channel.send(embed=embed_var) + await message.reply(embed=embed_var) return embed_var = discord.Embed(title="Timings Analysis", color=0x55ffff) @@ -175,7 +174,7 @@ class Timings(commands.Cog): if "LagAssist" in plugins: embed_var.add_field(name="❌ LagAssist", value="Plugins that claim to remove lag actually cause more lag. " - "Remove LagAssist.", + "LagAssist should only be used for analytics and preventative measures. All other features should be disabled.", inline=True) if "NoChunkLag" in plugins: embed_var.add_field(name="❌ NoChunkLag", @@ -292,11 +291,29 @@ class Timings(commands.Cog): value="bPermissions is an outdated permission plugin. " "Consider replacing it with [LuckPerms](https://ci.lucko.me/job/LuckPerms/1243/artifact/bukkit/build/libs/LuckPerms-Bukkit-5.2.77.jar).", inline=True) + if "DisableJoinMessage" in plugins and "Essentials" in plugins: + embed_var.add_field(name="❌ DisableJoinMessage", + value="You probably don't need DisableJoinMessage because Essentials already has its features. ", + inline=True) for plugin in plugins: - if "Songoda" in r["timingsMaster"]["plugins"][plugin]["authors"]: - embed_var.add_field(name="❌ " + plugin, - value="This plugin was made by Songoda. You should find an alternative.", - inline=True) + if "songoda" in r["timingsMaster"]["plugins"][plugin]["authors"].casefold(): + if plugin == "EpicHeads": + embed_var.add_field(name="❌ EpicHeads", + value="This plugin was made by Songoda. Songoda resources are poorly developed and often cause problems. You should find an alternative such as [HeadsPlus](spigotmc.org/resources/headsplus-»-1-8-1-16-4.40265/) or [HeadDatabase](https://www.spigotmc.org/resources/head-database.14280/).", + inline=True) + if plugin == "EpicHeads": + embed_var.add_field(name="❌ EpicHeads", + value="This plugin was made by Songoda. Songoda resources are poorly developed and often cause problems. You should find an alternative such as [HeadsPlus](spigotmc.org/resources/headsplus-»-1-8-1-16-4.40265/) or [HeadDatabase](https://www.spigotmc.org/resources/head-database.14280/).", + inline=True) + elif plugin == "UltimateStacker": + embed_var.add_field(name="❌ UltimateStacker", + value="Stacking plugins actually cause more lag. " + "Remove UltimateStacker.", + inline=True) + else: + embed_var.add_field(name="❌ " + plugin, + value="This plugin was made by Songoda. Songoda resources are poorly developed and often cause problems. You should find an alternative.", + inline=True) except KeyError: unchecked = unchecked + 1 @@ -1050,23 +1067,21 @@ class Timings(commands.Cog): embed_var.add_field(name="❌ Invalid Configuration", value="At least one of your configuration files had an invalid data type.", inline=True) - await message.channel.send(embed=embed_var) + await message.reply(embed=embed_var) return if len(embed_var.fields) == 0: embed_var.add_field(name="✅ All good", value="Analyzed with no issues") - await message.channel.send(embed=embed_var) + await message.reply(embed=embed_var) return issue_count = len(embed_var.fields) - if issue_count > 25: - embed_var.description = "Showing 25 of " + str(issue_count) + " recommendations." - else: - embed_var.description = "Showing " + str(issue_count) + " of " + str(issue_count) + " recommendations." - if issue_count > 0: - embed_var.description = embed_var.description + "\n||" + str(unchecked) + " missing configuration optimizations due to server version.||" - await message.channel.send(embed=embed_var) + if issue_count >= 25: + embed_var.insert_field_at(index=24, name="Plus " + str(issue_count - 24) + " more recommendations", value="Create a new timings report after resolving some of the above issues to see more,", inline=True) + if unchecked > 0: + embed_var.description = "||" + str(unchecked) + " missing configuration optimizations due to your server version.||" + await message.reply(embed=embed_var) def setup(bot):