backend: slope support, gui:add json

This commit is contained in:
David Brazda
2023-04-17 15:26:30 +02:00
parent c7d67fdf65
commit f4fbda7daf
20 changed files with 196 additions and 26 deletions

View File

@ -14,6 +14,18 @@ from v2realbot.common.model import StrategyInstance, Runner
from typing import List
import tomli
from v2realbot.config import DATA_DIR
import requests
def send_to_telegram(message):
apiToken = '5836666362:AAGPuzwp03tczMQTwTBiHW6VsZZ-1RCMAEE'
chatID = '5029424778'
apiURL = f'https://api.telegram.org/bot{apiToken}/sendMessage'
try:
response = requests.post(apiURL, json={'chat_id': chatID, 'text': message})
print(response.text)
except Exception as e:
print(e)
#datetime to timestamp
def json_serial(obj):