feat(pterodactyl): added achievements
Some checks failed
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 20s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 21s

This commit is contained in:
SeaswimmerTheFsh 2024-03-01 00:46:51 -05:00
parent 8954df4c1d
commit 7e03696e10
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
3 changed files with 73 additions and 0 deletions

View file

@ -175,6 +175,42 @@ class Pterodactyl(commands.Cog):
await config.server_regex.set(regex)
await ctx.send(f"Server regex set to:\n{box(regex, 'regex')}")
@pterodactyl_config_regex.command(name = "join")
async def pterodactyl_config_regex_join(self, ctx: commands.Context, *, regex: str = None) -> None:
"""Set the regex pattern to match join messages on the server.
See [documentation]() for more information."""
#TODO - fix this link
if regex is None:
regex = await config.join_regex()
return await ctx.send(f"Join regex is currently set to:\n{box(regex, 'regex')}")
await config.join_regex.set(regex)
await ctx.send(f"Join regex set to:\n{box(regex, 'regex')}")
@pterodactyl_config_regex.command(name = "leave")
async def pterodactyl_config_regex_leave(self, ctx: commands.Context, *, regex: str = None) -> None:
"""Set the regex pattern to match leave messages on the server.
See [documentation]() for more information."""
#TODO - fix this link
if regex is None:
regex = await config.leave_regex()
return await ctx.send(f"Leave regex is currently set to:\n{box(regex, 'regex')}")
await config.leave_regex.set(regex)
await ctx.send(f"Leave regex set to:\n{box(regex, 'regex')}")
@pterodactyl_config_regex.command(name = "achievement")
async def pterodactyl_config_regex_achievement(self, ctx: commands.Context, *, regex: str = None) -> None:
"""Set the regex pattern to match achievement messages on the server.
See [documentation]() for more information."""
#TODO - fix this link
if regex is None:
regex = await config.achievement_regex()
return await ctx.send(f"Achievement regex is currently set to:\n{box(regex, 'regex')}")
await config.achievement_regex.set(regex)
await ctx.send(f"Achievement regex set to:\n{box(regex, 'regex')}")
@pterodactyl_config.group(name = "messages", aliases = ['msg', 'msgs', 'message'])
async def pterodactyl_config_messages(self, ctx: commands.Context):
"""Configure message settings."""