Browse Source

Update timings.py

pull/9/head
DrBot7 4 years ago
committed by GitHub
parent
commit
878331587b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      cogs/timings.py

12
cogs/timings.py

@ -2,6 +2,7 @@ import discord
from discord.ext import commands from discord.ext import commands
import requests import requests
class Timings(commands.Cog): class Timings(commands.Cog):
def __init__(self, bot): def __init__(self, bot):
@ -9,6 +10,12 @@ class Timings(commands.Cog):
# Use @commands.Cog.listener() instead of event and use @commands.command() for commands # Use @commands.Cog.listener() instead of event and use @commands.command() for commands
# TODO: Add descriptions or hyperlink from the following links
# https://minecraft.gamepedia.com/Server.properties#Java_Edition_3
# https://bukkit.gamepedia.com/Bukkit.yml
# https://www.spigotmc.org/wiki/spigot-configuration/
# https://paper.readthedocs.io/en/latest/server/configuration.html
# https://pl3xgaming.github.io/PurpurDocs/Configuration/
async def analyze_timings(self, message): async def analyze_timings(self, message):
enterless_message = message.content.replace("\n", " ") enterless_message = message.content.replace("\n", " ")
words = enterless_message.split(" ") words = enterless_message.split(" ")
@ -21,7 +28,7 @@ class Timings(commands.Cog):
"https://timings.spigotmc.org/?url="): "https://timings.spigotmc.org/?url="):
embed_var = discord.Embed(title="Timings Analysis", color=0x55ffff) embed_var = discord.Embed(title="Timings Analysis", color=0x55ffff)
embed_var.add_field(name="❌ Spigot", embed_var.add_field(name="❌ Spigot",
value="Upgrade to [Purpur](https://purpur.pl3x.net/downloads/).")
value="Upgrade to [Purpur](https://purpur.pl3x.net/downloads/#1.16.4).")
embed_var.set_footer(text="Requested by " + message.author.name, icon_url=message.author.avatar_url) embed_var.set_footer(text="Requested by " + message.author.name, icon_url=message.author.avatar_url)
embed_var.url = timings_url embed_var.url = timings_url
await message.reply(embed=embed_var) await message.reply(embed=embed_var)
@ -951,6 +958,9 @@ class Timings(commands.Cog):
except ValueError: except ValueError:
embed_var.add_field(name="❌ Invalid Configuration", embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.") value="At least one of your configuration files had an invalid data type.")
except TypeError:
embed_var.add_field(name="❌ Invalid Configuration",
value="At least one of your configuration files had an invalid data type.")
if len(embed_var.fields) == 0: if len(embed_var.fields) == 0:
embed_var.add_field(name="✅ All good", embed_var.add_field(name="✅ All good",

Loading…
Cancel
Save