del fix_rcon_text

This commit is contained in:
2023-11-23 20:08:44 +03:00
parent 49ccb76933
commit ee70027d31

View File

@@ -72,19 +72,11 @@ class Permissions:
perms = Permissions(config['permission_file'])
def fix_rcon_text(_srt):
try:
_srt = re.sub(r'§.', '', _srt)
except Exception as e:
log(f"fix_rcon_text ERROR with: {_srt}", 1)
_srt = f'CRITICAL ERROR: {e}'
return _srt
def rcon(cmd):
try:
with MCRcon(host, password, port) as mcr:
return fix_rcon_text(mcr.command(cmd))
text = mcr.command(cmd)
return re.sub(r'§.', '', text)
except Exception as e:
log(f"RCON ERROR with command: {cmd}", 1)
print(traceback.format_exc())