Skip to content

Commit cfb3297

Browse files
committed
Create bot.php
1 parent 1abc936 commit cfb3297

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

examples/bot.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
require "vendor/autoload.php";
3+
require "config.php";
4+
//
5+
use App\CoderLast\Framework;
6+
use App\CoderLast\Plugins;
7+
//
8+
$bot = new Framework($config['TOKEN']);
9+
$plugins = new Plugins($config['TOKEN']);
10+
11+
$home = [["Hello word!", "Hello word!"]];
12+
13+
$input = $bot->getInput();
14+
if(isset($input->message)){
15+
$message = $input->message;
16+
$chat_id = $message->chat->id;
17+
$text = $message->text;
18+
}
19+
20+
if ($text == "/start"){
21+
$bot->sendMessage($chat_id, "Hello World");
22+
}

0 commit comments

Comments
 (0)