feat(pterodactyl): updated how placeholders are parsed in get_chat_command(), updated documentation to match
All checks were successful
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 19s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 23s

This commit is contained in:
SeaswimmerTheFsh 2024-03-01 15:21:44 -05:00
parent 1bc1c7a90e
commit 4979e44b7c
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
2 changed files with 11 additions and 5 deletions

View file

@ -83,7 +83,13 @@ class Pterodactyl(commands.Cog):
async def get_chat_command(self, username: str, message: str, color: discord.Color) -> str:
command: str = await config.chat_command()
command = command.replace(".$U", username).replace(".$M", message).replace(".$C", str(color))
placeholders = {
"U": username,
"M": message,
"C": str(color)
}
for key, value in placeholders.items():
command = command.replace('$.' + key, value)
return command
@commands.Cog.listener()