diff --git a/cogs/servertatus.py b/cogs/servertatus.py index c8bd036..14e4649 100644 --- a/cogs/servertatus.py +++ b/cogs/servertatus.py @@ -1,33 +1,26 @@ import discord from discord.ext import commands -#from decorators import help -#from enums.help_categories import Category -#from functions import checks from mcstatus import MinecraftServer -class Cog(commands.Cog): +class ServerStatus(commands.Cog): def __init__(self, client): self.client = client - # Don't allow any commands to work when locked - #def cog_check(self, ctx): - # return not self.client.locked - @commands.command() async def ping(self, ctx): - #play.worldcraft.us - #81.82.224.207 - #25568 + #25568 -> Earth + #25567 -> Moon server = MinecraftServer.lookup("81.82.224.207:25568") - #status = server.status() try: latency = server.ping() - await ctx.send("🟢 The Minecraft Server replied in {0} ms".format(latency)) + embedVar = discord.Embed(title="", description="", color=0x00ff00) + embedVar.add_field(name="Server1", value="🟢 The Minecraft Server replied in {0} ms".format(latency), inline=False) + await ctx.send(embed=embedVar) except ConnectionRefusedError: await ctx.send("🔴 The Minecraft Server is offline") def setup(client): - client.add_cog(Cog(client)) + client.add_cog(ServerStatus(client))