如何在Laravel 5.0 setwebhook中通过irazasyed telegram freamwork重播消息
我使用了Laravel5.0和Irazasyed电报机器人,我想通过webhook工作,当一个人向电报机器人发送消息时,电报会自动向该机器人发送消息 我的代码在这里,webhook无法使用:如何在Laravel 5.0 setwebhook中通过irazasyed telegram freamwork重播消息,laravel,telegram-bot,Laravel,Telegram Bot,我使用了Laravel5.0和Irazasyed电报机器人,我想通过webhook工作,当一个人向电报机器人发送消息时,电报会自动向该机器人发送消息 我的代码在这里,webhook无法使用: <?php namespace App\Http\Controllers; use App\Http\Requests; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Technical; use
<?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Technical;
use Illuminate\Support\Facades\Session;
use Url;
use Telegram\Bot\Api;
use Telegram\Bot\Laravel\Facades\Telegram;
use Artisaninweb\SoapWrapper\Facades\SoapWrapper;
class HomeController extends Controller {
public function __construct()
{
//$this->middleware('auth');
}
public function index()
{
$telegram = new Api('117451573:*********************', 'true');
$telegram->setWebhook(['url' => 'https://******.com/117451573:********************/webhook']);
$update = $telegram->getWebhookUpdates();
$telegram->sendMessage([
'chat_id' => '********',
'text' => 'thanks',
]);
return response()->json(["status" => "success"]);
}
}
我也在努力工作。这里有一个教程:,似乎是最新的。我没有时间自己测试它。希望在接下来的几天里
要使用webhooks,您必须在shell中调用以下命令一次
curl-H“内容类型:application/json”-X POST-d'{“url”:https://www.example.com/my-secret-webhook.php"}' https://api.telegram.org/botYOUR_BOT_TOKEN/setWebhook
见第二章。在教程中配置Webhook
祝你好运请阅读有关增加引起注意的机会的提示,并为你的问题找到答案。