Giter Club home page Giter Club logo

Comments (11)

akalongman avatar akalongman commented on July 22, 2024 1

@ranrinc we will write documentation soon, but now you can just install it and call in the controller needed methods:

<?php
namespace App\Http\Controllers;

use PhpTelegramBot\Laravel\PhpTelegramBotContract;

class CustomController extends Controller
{
    public function handle(PhpTelegramBotContract $telegram_bot)
    {
        // Call handle method
        $telegram_bot->handle();
    }

    public function setWebhook(PhpTelegramBotContract $telegram_bot)
    {
        // Set webhook 
        $telegram_bot->setWebhook($hook_url);
    }

}

from laravel.

ranrinc avatar ranrinc commented on July 22, 2024

Hi there,

Is there away to get example? so at least I can begin testing it?

from laravel.

ranrinc avatar ranrinc commented on July 22, 2024

Where should i put that script? And how to called it? I need the commands.. where should i put it and how to begin called it too? Still confuse with laravel at the moment.. help?

from laravel.

akalongman avatar akalongman commented on July 22, 2024

@ranrinc you are a beginner in Laravel? You should create controller, e.g. TelegramController and put the code above in the controller. Also, create routes for your controller methods.
If you want custom commands, create the folder Telegram/Commands and put your commands inside and specify commands path in the telegram bot config, like 'path' => app_path('Telegram/Commands')

from laravel.

ranrinc avatar ranrinc commented on July 22, 2024

Kind of laravel beginner.. ... will try... got it about telegram controller.. still confused on making the commands though.. cause i cant see relation in making a call /help from the telegram and trigger the HelpCommands...in laravel so far... maybe another hints? Sorry..

from laravel.

akalongman avatar akalongman commented on July 22, 2024

You have to set up webhook as described here and specify your Laravel's handle url

from laravel.

ranrinc avatar ranrinc commented on July 22, 2024

So i need to create hook and set?? Again so sorry.. i have been confused for a long time for this and hoping to learn it from this fork..I hope you dont mind to teach nubie

from laravel.

akalongman avatar akalongman commented on July 22, 2024

So i need to create hook and set??

Yes

from laravel.

ranrinc avatar ranrinc commented on July 22, 2024

Do u mind helping me for hook.php and where should i put it on?

from laravel.

akalongman avatar akalongman commented on July 22, 2024

@ranrinc you should put hook.php under public folder

from laravel.

nullcookies avatar nullcookies commented on July 22, 2024

Using laravel, do you need to install hook on CustomController?

from laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.