问题描述
我在Telegram Bot中工作,该Bot从数组中获取随机数并将其输出,但是还有另外一个if语句,其中一个sendMessage函数没有响应。 我有很多类似的if语句,它们可以正常工作。
if else语句:
if(strpos($message,"/rand")===0){
sendMessage($chatId,'<b>Getting a number...</b>');
sendMessage($chatId,'<b>Number</b>: <i>' .$result. '</i>%0A%0A');
sendMessage($botGroupId,'@'.$username.'/'.$userId. ' has used ' .$message. ' command');
}
用户未从if else语句中收到此消息:
sendMessage($chatId,'<b>Number</b>: <i>' .$result. '</i>%0A%0A');
include 'randnum.PHP';//get content from PHP files --> include the PHP file...
$getindex_from_array=array_rand($randnumbers); //gen random index
$result=$randnumbers[$getindex_from_array]; //get a random number from gen index
//end
<?PHP
$randnumbers=array("44534","347467","4734856","475348568");
?>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)