<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Sender</title>
<script type="text/javascript" src="eel.js"></script>
</head>
<body>
<div class="block">
<input type="text" placeholder="Введите индефикатор пользователя: " id="id">
<textarea placeholder="Сообщение" id="message"></textarea>
<button type="submit" id="button">Отправить</button>
<p id="result"></p>
</div>
<script>
async function send_msg(){
let chat_id = document.getElementById('id').value;
let message = document.getElementById('message').value;
let result = await eel.send_message(chat_id, message)();
document.getElementById('result').innerHTML = result;
}
document.getElementById('button').onclick = function(){
send_msg();
}
</script>
</body>
</html>
import eel
import telebot
bot = telebot.Telebot("########################");
@eel.expose
def send_message(chat_id, message):
bot.send_message(chat_id, message);
return "Сообщение отправлено!";
eel.init('web');
eel.start('index.html', size = (1000, 700));