feat(pterodactyl): added a regex blacklist command
This commit is contained in:
parent
5c2bfea238
commit
f6ebbae583
4 changed files with 58 additions and 3 deletions
|
@ -45,8 +45,10 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None:
|
|||
logger.info("WebSocket authentication successful")
|
||||
|
||||
if json.loads(message)['event'] == 'console output' and await config.console_channel() is not None:
|
||||
if await config.current_status() in ('running', 'offline', ''):
|
||||
content = remove_ansi_escape_codes(json.loads(message)['args'][0])
|
||||
msg = json.loads(message)['args'][0]
|
||||
regex_blacklist = await config.regex_blacklist()
|
||||
if await config.current_status() in ('running', 'offline', '') and not any(re.match(regex, msg) for regex in regex_blacklist):
|
||||
content = remove_ansi_escape_codes(msg)
|
||||
if await config.mask_ip() is True:
|
||||
content = mask_ip(content)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue