This commit is contained in:
2023-03-28 20:28:49 +03:00
parent 4f8110d675
commit 8d09e8aea8
7 changed files with 63 additions and 0 deletions

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

8
.idea/Rcon-VK-Bot.iml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.10" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Rcon-VK-Bot.iml" filepath="$PROJECT_DIR$/.idea/Rcon-VK-Bot.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

28
main.py Normal file
View File

@@ -0,0 +1,28 @@
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()