我想发送定时消息,比如@alertbot,我的代码是这样的。但是在20:30,机器人不发送任何信息。
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
}
}
我的剧本出了什么问题?