Closed ranrinc closed 4 years ago
Hi there,
Is there away to get example? so at least I can begin testing it?
@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);
}
}
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?
@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')
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..
You have to set up webhook as described here and specify your Laravel's handle url
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
So i need to create hook and set??
Yes
Do u mind helping me for hook.php and where should i put it on?
@ranrinc you should put hook.php under public
folder
Using laravel, do you need to install hook on CustomController?
Hi there,
Will support this project, however wondering how can I implement the commands etc..Maybe we can have example too for the laravel program.
Need to get more info on where we need to add TOKENBOT etc...
Thanks..