Closed seyfer closed 7 years ago
I could create factory for
/**
* Class Dialogs
* @package BotDialogs
*/
class Dialogs
...
/**
* @param Api $telegram
* @param Redis $redis
*/
public function __construct(Api $telegram, Redis $redis)
But it depends on
use Illuminate\Redis\Database as Redis;
use Illuminate\Support\Facades\Config;
How to init and configure this components?
Connected issue https://github.com/zarincheg/telegram-bot-dialogs/issues/6
Hi, thank for question. I developed this extension for Laravel/Lumen usage at first and did not test with another frameworks or stand-alone.
But it depends on
use Illuminate\Redis\Database as Redis; use Illuminate\Support\Facades\Config;
How to init and configure this components?
You can install this components by composer.
@zarincheg I'm asking about config file structure. I want to use them in ZF3 factory, something like
$redis = new Redis($config);
$config = new Config($config);
$dialogues = new Dialogues($redis, $config);
return $dialogues;
So, what the structure of the $config
should be for manual instantiation?
<?php
return [
/**
* Aliases for different meanings of words.
*/
'aliases' => [
'yes' => ['yes', 'yep', 'да', 'ага', 'угу', 'знаю', 'помню'],
'no' => ['no', 'nope', 'нет', 'не знаю', 'незнаю', 'не помню', 'непомню']
],
/**
* Timeout for dialog memory in seconds
*/
'expires' => env('DIALOGS_MEMORY_TIMEOUT', 300),
// It is for YAML-described dialogs, optional
'scenarios' => [
\Bot\Telegram\Dialogs\FeedbackDialog::class => base_path('config/dialogs/feedback.yml')
],
];
Conversation moved to #7
@zarincheg will extension work without Laravel ? I'm use different framework.
Please, provide example of config.php (with description of possible options) file and how to configure dialogues without framework (with which methods and in which order, step by step).