@bot.on.chat_message()
async def message_handler(message: Message):
await message.answer("Тест!")
@bot.on.chat_message()
async def message(message: Message):
print("Тестовый PRINT")
if message.text=="тест":
await message_handler(message)
// JSON.parse не берёт, поэтому
var your_object = eval(`({
'0': {
title: 'exampleTitle',
published: { date: 'exampleDate', time: 'exampleTime' }
}
})`);
for (k in your_object) {
var title = your_object[k].title;
var published_date = your_object[k].published.date, published_time = your_object[k].published.time;
}
def main():
original_file = "pp-complete.csv"
with open(original_file, encoding="UTF-8", newline="") as of:
reader = csv.reader(of)
for row in reader:
Transaction_ID, Price, Date_of_Transfer, Postcode, Property_Type, Old_or_New, Duration,
PAON, SAON, Street, Locality, Town_or_City,
District, County, PPD_Category_Type, Record_Status = row
# что-то делаешь дальше именно с этой с одной строкой
# и идёшь дальше
$mail = $_POST['mail'];
$mail = trim($mail);
$mail = $link->real_escape_string($mail);
$info_user = mysqli_fetch_assoc($link->query("SELECT * FROM `user` WHERE mail = $mail"));
if($info_user) {
echo '1';
}
else {
echo '2';
}
$mail = $_POST['mail'];
$mail = trim($mail);
$stmt = $link->prepare("SELECT * FROM user WHERE mail = ?");
$stmt->bind_param("s", $mail); // here we can use only a variable
$stmt->execute();
$result = $stmt->get_result();
$info_user = $result->fetch_all(MYSQLI_ASSOC);
if($info_user) {
echo '1';
}
else {
echo '2';
}
.text.strip().replace(chr(160), " ")
import re
int(re.sub(r"[^\d]+", "", item.find("div", class_ = "css-1dv8s3l eyvqki91").text))
import asyncio
from aiogram import Bot, Dispatcher
from aiogram.types import BotCommand
from aiogram.contrib.fsm_storage.memory import MemoryStorage
async def set_commands(bot: Bot):
commands = [
BotCommand(command="/drinks", description="Заказать напитки"),
BotCommand(command="/food", description="Заказать блюда"),
BotCommand(command="/cancel", description="Отменить текущее действие")
]
await bot.set_my_commands(commands)