mirror of
https://github.com/RGBCube/minearchy-bot
synced 2025-07-27 00:47:44 +00:00
Feat: =servers, aliases for =status and cleanup repo
This commit is contained in:
parent
2265ab2f62
commit
c7060de642
3 changed files with 44 additions and 6 deletions
|
@ -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.",
|
||||
)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue