import json

import requests

from config import TOKEN

TELEGRAM_API_URL = "https://api.telegram.org/bot{}/sendMessage".format(TOKEN)

def bot_send_message(chat_id: int, text: str):

    keyboard = {
        "keyboard": [
            [{"text": "Продолжить"}]
        ],
        "resize_keyboard": True,
        "one_time_keyboard": True,
    }

    payload = {'chat_id': chat_id, 'text': text, 'reply_markup': json.dumps(keyboard)}

    try:
        response = requests.get(TELEGRAM_API_URL, json=payload)
        response.raise_for_status()
    except requests.exceptions.HTTPError as e:
        pass
