start coding

This commit is contained in:
Mikhail Shahovalov
2025-03-16 01:02:04 +03:00
parent 860acb368c
commit d8250f17cb
7 changed files with 62 additions and 1 deletions

15
.vscode/launch.json vendored Normal file
View File

@@ -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"
}
]
}

3
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"python-envs.pythonProjects": []
}

View File

@@ -1,3 +1,19 @@
# GameServerBot # GameServerBot
Бот для управления игровыми серверами Бот для управления игровыми серверами
Нужено
1. Бекап по расписанию и запросу
2. Запус/Остановка сервера
3. SteamCMD обновления
Обновить requirements.txt
pip freeze > requirements.txt
Использовать requirements.txt
pip install -r requirements.txt
Включить виртуальное окружение
.\venv\Scripts\activate # On Windows

3
appsettings.json Normal file
View File

@@ -0,0 +1,3 @@
{
"BotToken": "Token"
}

8
configurations.py Normal file
View File

@@ -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'

10
main.py Normal file
View File

@@ -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)

6
requirements.txt Normal file
View File

@@ -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