0

I want to build a bot in Telegram with Laravel 5.3, but I have some problems...

My site is located on the computer. How can I register some easy commands (/help, /start)? When I'm writing to bot, it doesn't respond to commands :( But I can get the bot data (id, firstname and bot name). This is my ugly TelegramController:

<?php

namespace App\Http\Controllers;

use Telegram\Bot\Laravel\Facades\Telegram;

class TelegramController extends Controller
{

    public function index()
    {

        $response = Telegram::getMe();
        dd($response);
    }
}

Please, write some examples... I do not understand what is written in the docs. Have a good day and thanks for help!

Github repository: https://github.com/irazasyed/telegram-bot-sdk

hatef
  • 5,491
  • 30
  • 43
  • 46
MyZik
  • 220
  • 2
  • 15

2 Answers2

1

You need to generate a self signed certificate and send it as a parameter through setWebHook to Telegram.

Using self-signed certificates

If you're hosting it on your computer!

Ali Padida
  • 1,763
  • 1
  • 16
  • 34
0

There are two ways you can handle user commands.

  1. using self signed certificates
  2. using Webhook (recommended) Get rid of processing each request manually or setting timers

You are specifically looking for a Laravel bot so you can find the unofficial package here

and here is a step by step guide for you to get started. This blog also has a series of telegram bot articles that helps set Webhook, keyboards and callbacks

If you are looking to buy cheap SSL certificates you can go for SSLS and check out FREE SSL

Ashik Basheer
  • 1,531
  • 3
  • 16
  • 36