i want to send timed message likes @alertbot, my code like this. but at 20.30 the bot doesnt send any message.
date_default_timezone_set("mytimezone");
$time = date(H:i);
$date = date(d/m/Y);
$pesan = “/alert 20:30 27/04/2017 some texts”;
$chatid = 13245;
$texts = explode(“ “,$pesan,4);
$message = $texts[0];
switch ($message) {
case ‘/alert’:
$times = $texts[1];
$dates = $texts[2];
$text = $texts[3];
while ($times == $time && $dates == $date) {
sendMessage($chatid,$text);
break;
// the bot will stop after sendMessage to chatid
}
}
what's wrong with my script?