studio icon indicating copy to clipboard operation
studio copied to clipboard

Override config

Open kurumbus opened this issue 5 years ago • 2 comments

I'm working on an app, where a user can create bots for facebook. That in turn requires config (app_secret, token and verification) to be dynamic and not set in config/botman/facebook.php.

So question is: If I use botman studio, can I set configuration and credentials dynamically?

So OK, maybe I shouldn't have chosen exactly "botman studio", but it was a while ago.

I tried `

    DriverManager::loadDriver(\BotMan\Drivers\Facebook\FacebookDriver::class);

    $botman = BotManFactory::create([

        'token' => $x,

        'app_secret' => $y,

        'verification'=> $z,

    ]);

` but it doesn't work. in the log I found that token=null in the sent request

What did work though was setting credentials in the config and just $botman = resolve('botman'); I did that to eliminate the possibility that I messed up the integration part, or that I misunderstood about some token or something.

Thank you for your app and the whole infrastructure though, my work would not be possible without it in the first place

kurumbus avatar May 19 '20 03:05 kurumbus

ugh silly me, I missed driver key

it should have been

not

[
        'token' => $x,

        'app_secret' => $y,

        'verification'=> $z,
 ]

but


[ 'facebook' =>

        'token' => $x,

        'app_secret' => $y,

        'verification'=> $z,

    ]
]

kurumbus avatar May 20 '20 02:05 kurumbus

But maybe it would make sense do give an example here? https://botman.io/2.0/driver-facebook-messenger image

kurumbus avatar May 20 '20 02:05 kurumbus