微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么此功能不响应?

如何解决为什么此功能不响应?

我在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

这是我如何在数组(randnum.PHP)中添加数字:

<?PHP
$randnumbers=array("44534","347467","4734856","475348568");
?>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。