@bot.message_handler(commands = 'fjasdi')
def rassilka(message):
cursor.execute('SELECT id FROM login_id WHERE id ="' + str(message.chat.id) + '"')
result = cursor.fetchall()
msg = 'Проверка'
for x in result:
bot.send_message(x[0], str(msg))
@bot.message_handler(commands = 'fjasdi')
def rassilka(message):
cursor.execute('SELECT id FROM login_id WHERE id ="' + str(message.chat.id) + '"'
result = cursor.fetchall()
msg = 'Проверка'
for x in result:
bot.send_message(result[YOU_BD_NUMBER], str(msg))
<?php
/* https://api.telegram.org/bot2034173056:AAHU3qAkxa9tHObNmIaWyPX87mUoZJeNlJQ/getUpdates,
где, XXXXXXXXXXXXXXXXXXXXXXX - токен вашего бота, полученный ранее */
$tel = $_POST['tel'];
$email = $_POST['email'];
$token = "2034173056:AAHU3qAkxa9tHObNmIaWyPX87mUoZJeNlJQ";
$chat_id = "-449664837";
$arr = array(
'Телефон: ' => $tel,
'Email' => $email,
);
foreach($arr as $key => $value) {
$txt .= "<b>".$key."</b> ".$value."%0A";
};
$txt = rawurlencode($txt);
//$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r");
function sendTelegramMessage(string $message)
{
$config = config();
$TOKEN = $config['tg']['token'];
$ID = $config['tg']['id'];
file_get_contents("https://api.telegram.org/bot".$TOKEN."/sendMessage?chat_id=".$ID."&text=".urlencode($message));
}
if ($sendToTelegram) {
echo ('Готово');
//header('Location: ');
}
else {
echo "Error";
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ФОРМА ЗАЯВКИ</title>
<meta name="viewport" content="device-width" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/media-quiries.css">
</head>
<body>
<div class="content">
<h1>Оставить заявку!</h1>
<input type="email" name="email"><br>
<a id="fig" href="#">Отправить</a>
</div>
</body>
</html>
body {
-webkit-tap-highlight-color: transparent;
}
.content {
margin: 0 auto;
width: 300px;
}
input {
background-color: white;
border: 0.2px solid black;
font-size: 20px;
padding: 10px;
border-radius: 30px;
outline: none;
}
input:hover {
background-color: white;
box-shadow: 0 0 15px green;
border: 0 solid black;
}
@media screen and (max-width: 640px) {
.content {
width: 240px;
}
h1 {
font-size: 30px;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ФОРМА ЗАЯВКИ</title>
<meta name="viewport" name="width=device-width" />
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/media-quiries.css">
</head>
<body>
<div class="content">
<h1>Оставить заявку!</h1>
<input type="email" name="email"><br>
<a id="fig" href="#">Отправить</a>
</div>
</body>
</html>
.content {
margin: 0 auto;
width: 300px;
}
@media screen and(max-width: 480px) {
h1 {
font-size: 24px;
}
}
@bot.message_handler(commands = ['tgsuufj'])
for chat_id in list_of_chat_ids:
bot.send_message(chat_id, message_text)
time.sleep (1/31) # чтобы уж точно не превышать 30 в секунду
bot.polling(none_stop = True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/bin/pythonanywhere_runner.py", line 26, in _pa_run
code = compile(f.read(), filename.encode("utf8"), "exec")
File "/home/TellS/prost.py", line 168
for chat_id in list_of_chat_ids:
^
IndentationError: expected an indented block
https://pastenow.ru/E9PJI
https://pastenow.ru/E9PK8
Больше он негде не используется
Если есть возможность дайте свой телеграм там я смогу скинуть вам код