diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0854bd9 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Используйте IntelliSense, чтобы узнать о возможных атрибутах. + // Наведите указатель мыши, чтобы просмотреть описания существующих атрибутов. + // Для получения дополнительной информации посетите: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Отладчик Python: Текущий файл", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..7e68766 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python-envs.pythonProjects": [] +} \ No newline at end of file diff --git a/README.md b/README.md index cca7ba0..ec375a2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ # GameServerBot -Бот для управления игровыми серверами \ No newline at end of file +Бот для управления игровыми серверами + + +Нужено +1. Бекап по расписанию и запросу +2. Запус/Остановка сервера +3. SteamCMD обновления + + +Обновить requirements.txt +pip freeze > requirements.txt + +Использовать requirements.txt +pip install -r requirements.txt + +Включить виртуальное окружение +.\venv\Scripts\activate # On Windows diff --git a/appsettings.json b/appsettings.json new file mode 100644 index 0000000..323b5fb --- /dev/null +++ b/appsettings.json @@ -0,0 +1,3 @@ +{ + "BotToken": "Token" +} \ No newline at end of file diff --git a/configurations.py b/configurations.py new file mode 100644 index 0000000..67c764c --- /dev/null +++ b/configurations.py @@ -0,0 +1,8 @@ +import json +import io + +with io.open('appsettings.json', 'r', encoding='utf-8') as f: + settings = json.load(f) + +class BotSettings: + Token: str = 'Token' \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..2bb8900 --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +import telebot +from configurations import BotSettings + +bot = telebot.TeleBot(BotSettings.Token) + +@bot.message_handler(content_types=['text']) +def get_text_messages(message): + bot.send_message(message.chat.id, 'Привет, я бот для управления серверами') + +bot.polling(none_stop=True, interval=0) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c63cbf4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +certifi==2025.1.31 +charset-normalizer==3.4.1 +idna==3.10 +pyTelegramBotAPI==4.26.0 +requests==2.32.3 +urllib3==2.3.0