Added CommandHandler

This commit is contained in:
Netkas 2023-02-19 17:25:59 -05:00
parent eacc106666
commit 2362365865
5 changed files with 134 additions and 3 deletions

View file

@ -1,7 +1,13 @@
<?php
use commands\StartCommand;
require 'ncc';
import('net.nosial.tgbotlib');
$bot = new TgBotLib\Bot('5126030313:AAEn3QcwSvTJ2eAKUnSb_MkC5U0tlqkM1xw');
$bot->sendMessage(chat_id: 570787098, text: 'Hello world!');
require 'commands/StartCommand.php';
$bot = new TgBotLib\Bot('YOUR_BOT_TOKEN');
$bot->setCommandHandler('start', new StartCommand());
$bot->handleGetUpdates(true);