mirror of
https://github.com/SantaSpeen/Rcon-VK-Bot.git
synced 2026-04-10 09:56:02 +00:00
29 lines
505 B
Python
29 lines
505 B
Python
from mcrcon import MCRcon
|
|
|
|
|
|
|
|
def fix_rcon_text(_srt):
|
|
try:
|
|
_srt = list(_srt)
|
|
for i in range(len(_srt)):
|
|
if _srt[i] == '§':
|
|
_srt[i] = ''
|
|
_srt[i + 1] = ''
|
|
_srt = ''.join(_srt)
|
|
except Exception as e:
|
|
_srt = f'CRITICAL ERROR: {e}'
|
|
return _srt
|
|
|
|
|
|
def rcon(cmd):
|
|
with MCRcon(host, password, port) as mcr:
|
|
return fix_rcon_text(mcr.command(cmd))
|
|
|
|
|
|
def main():
|
|
pass
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|