Interactive menu
This commit is contained in:
42
app/Paper/InteractiveMenu.php
Normal file
42
app/Paper/InteractiveMenu.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Paper;
|
||||
|
||||
|
||||
class InteractiveMenu
|
||||
{
|
||||
|
||||
private $apiKey;
|
||||
|
||||
private $paper;
|
||||
|
||||
private $redis;
|
||||
|
||||
private $structure = [
|
||||
0 =>
|
||||
[
|
||||
'title' => 'tytuł pierwszego menu',
|
||||
1 => ['name' => 'to jest podtytuł pierwszego menu', 'action' => '', 'type' => 'output'],
|
||||
2 => ['name' => 'to jest podtytuł drugiego menu', 'action' => '', 'type' => 'input'],
|
||||
3 => ['name' => 'to jest podtytuł trzeciego menu', 'action' => '', 'type' => 'outputandinput'],
|
||||
4 => ['name' => 'to jest podtytuł czwartego menu', 'action' => '', 'type' => 'inputandoutput'],
|
||||
]
|
||||
];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->paper = new Paper();
|
||||
$this->redis = new \Redis();
|
||||
$this->redis->connect('127.0.0.1', 6379);
|
||||
$this->redis->setex('interactivemenu', 10, 1);
|
||||
}
|
||||
|
||||
public function pressed($key)
|
||||
{
|
||||
$this->paper->sendPrint($key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user