Minor Changes
This commit is contained in:
parent
11e60c56c4
commit
e3ed0529b9
4 changed files with 34 additions and 21 deletions
|
@ -18,6 +18,8 @@
|
|||
public function handle(Bot $bot, Update $update): void
|
||||
{
|
||||
// reply to the incoming message
|
||||
$bot->sendMessage($update->getMessage()->getChat()->getId(), 'Hello, ' . $update->getMessage()->getFrom()->getFirstName());
|
||||
$bot->sendMessage(
|
||||
$update->getMessage()->getChat()->getId(), 'Hello, ' . $update->getMessage()->getFrom()->getFirstName()
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,13 +1,14 @@
|
|||
<?php
|
||||
|
||||
use commands\StartCommand;
|
||||
|
||||
require 'ncc';
|
||||
import('net.nosial.tgbotlib');
|
||||
|
||||
require 'commands/StartCommand.php';
|
||||
|
||||
$bot = new TgBotLib\Bot('YOUR_BOT_TOKEN');
|
||||
$bot->setCommandHandler('start', new StartCommand());
|
||||
$bot = new TgBotLib\Bot('865804194:AAHTo9aIFP5X47dMYLJ6eoldHJnM6sc3LBc');
|
||||
$bot->setCommandHandler('start', new \commands\StartCommand());
|
||||
|
||||
$bot->handleGetUpdates(true);
|
||||
print_r(json_encode($bot->getMe()->toArray()) . PHP_EOL);
|
||||
$bot->sendMessage(570787098, 'Hello, world!');
|
||||
$bot->handleGetUpdates();
|
||||
unset($bot);
|
Loading…
Add table
Add a link
Reference in a new issue