diff --git a/.gitignore b/.gitignore index 266bf86..213680a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,16 @@ * +venv/ !.gitignore + +!.github/workflows/ +!.github/workflows/scripts/ + +!minearchy_bot/ +!minearchy_bot/cogs/ +!minearchy_bot/minecraft_server/ +!minearchy_bot/utils/ + !*.py !*.example.json !*.sh diff --git a/minearchy_bot/cogs/minecraft_server.py b/minearchy_bot/cogs/minecraft_server.py index 88a3b4a..2a8c898 100644 --- a/minearchy_bot/cogs/minecraft_server.py +++ b/minearchy_bot/cogs/minecraft_server.py @@ -53,6 +53,33 @@ class MinecraftServer( ) @command( + aliases = ("servers",), + brief = "Sends info about a specific server.", + help = "Sends info about a specific server.", + ) + async def server(self, ctx: Context, server: str | None = None) -> None: + servers = { + "smp": "The SMP is a server where people can play survival Minecraft alongside other members of the community, with a multitude of features such as shops, auctions and more.", + "kitpvp": "The KitPvP server is a server where players can fight each other with preset items called kits. These kits can be used in prebuilt arenas. The aim of KitPvp is too defeat your opponent in combat, with whatever kit you chose.", + } + + if server is None: + await ctx.reply( + f"You must specify a server. The available servers are: {', '.join(f'`{s}`' for s in servers)}." + ) + return + + server = server.lower() + if server not in servers: + await ctx.reply( + f"Invalid server. The available servers are: {', '.join(f'`{s}`' for s in servers)}." + ) + return + + await ctx.reply("```\n" + servers[server] + "\n```") + + @command( + aliases = ("players", "playerlist"), brief = "Shows information about the Minecraft server.", help = "Shows the total player count, the Minecraft server IP and the server latency.", ) diff --git a/minearchy_bot/cogs/moderation.py b/minearchy_bot/cogs/moderation.py index c5db9c1..1ebaa77 100644 --- a/minearchy_bot/cogs/moderation.py +++ b/minearchy_bot/cogs/moderation.py @@ -25,12 +25,6 @@ class Moderation( ): def __init__(self, bot: MinearchyBot) -> None: self.bot = bot - self.time_values = { - "d": "days", - "h": "hours", - "m": "minutes", - "s": "seconds", - } self.sniped = DefaultDict(Deque) @command( @@ -40,6 +34,13 @@ class Moderation( ) @commands.has_permissions(manage_messages = True) async def timeout(self, ctx: Context, member: Member, duration: str = "1d") -> None: + time_values = { + "d": "days", + "h": "hours", + "m": "minutes", + "s": "seconds", + } + if duration[-1] not in self.time_values or len(duration) < 2: await ctx.reply("Invalid duration. Valid durations are: d, h, m, s.") return