|
9 | 9 | <br> |
10 | 10 | <a href="https://telegram.me/Clframework">Telegram Support Group</a> <b>Telegram Guruximiz</b> |
11 | 11 | </div> |
12 | | - |
13 | | -## Ornatish - composer orqali |
14 | | -``` |
15 | | -composer require coderlast/clframework |
16 | | -``` |
17 | | -Composer orqali yuklaganigizdan kegin |
18 | | - |
19 | | -*config.php* - fayl yarating va uni ichiga 👇 |
20 | | -``` |
21 | | -$config = [ |
22 | | - "TOKEN"=>"bot tokeni", |
23 | | -]; |
24 | | -``` |
25 | | -#### Kegin index.php fayl yaratamiz va uni ichiga 👇 |
26 | | - |
27 | | -```php |
28 | | -<?php |
29 | | -require "vendor/autoload.php"; |
30 | | -require "config.php"; |
31 | | - |
32 | | -// |
33 | | -use App\CoderLast\Framework; |
34 | | -use App\CoderLast\Plugins; |
35 | | -// |
36 | | -$bot = new Framework($config['TOKEN']); |
37 | | -$plugins = new Plugins($config['TOKEN']); |
38 | | - |
39 | | - |
40 | | -$home = [["Hello word!", "Hello word !"]]; |
41 | | - |
42 | | -$input = $bot->getInput(); |
43 | | -if(isset($input->message)){ |
44 | | - $message = $input->message; |
45 | | - $chat_id = $message->chat->id; |
46 | | - $text = $message->text; |
47 | | - $userid = $message->from->id; |
48 | | - $name = $message->from->frist_name." ".$message->from->last_name; |
49 | | -} |
50 | | - |
51 | | -switch ($text) |
52 | | -{ |
53 | | - case "/start": |
54 | | - $bot->sendMessage($userid,"CLFramework - $name",[ |
55 | | - 'parse_mode'=>"markdown", |
56 | | - 'reply_markup'=>$plugins->Keyboards($home) |
57 | | - ]); |
58 | | - break; |
59 | | - case "Hello word!": |
60 | | - $a = $bot->getMethod(); |
61 | | - $bot->sendMessage($chat_id, print_r($a,true)); |
62 | | - break; |
63 | | - case "Hello word !": |
64 | | - $a = $plugins->getMethod(); |
65 | | - $bot->sendMessage($chat_id, print_r($a,true)); |
66 | | - break; |
67 | | -} |
68 | | -``` |
69 | | - |
70 | | - |
71 | | -Copyright © 2020 CoderLast |
0 commit comments