Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override config #92

Open
kurumbus opened this issue May 19, 2020 · 2 comments
Open

Override config #92

kurumbus opened this issue May 19, 2020 · 2 comments

Comments

@kurumbus
Copy link

kurumbus commented May 19, 2020

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
Copy link
Author

kurumbus commented May 20, 2020

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 kurumbus reopened this May 20, 2020
@kurumbus
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant