Carbon serialization: InvalidArgumentException

Posted 3 months ago by daronspence

I'm trying to build a slack bot using http://botman.io which is built on Laravel.

I've gotten everything working pretty much and now it's time to wire up the bot to a cron so it can ask questions at predetermined schedules.

However, starting a conversation without any user input first is causing an error.

This Issue is a good overview: https://github.com/botman/botman/issues/952

The only difference is I'm using the Slack driver and not the web driver.

What is weird, is if I speak to the bot first, and then the bot runs the EXACT SAME conversation, just that I initiated instead of the bot, it works fine.

I've even tried taking it out of the scheduler and running it in tinker and it fails.

$survey = \App\Survey::find(1);
$bot->startConversation( new \App\Conversations\SurveyResponseTestConversation( $survey->id ), $survey->slack_username, \BotMan\Drivers\Slack\SlackDriver::class);

This will throw the same InvalidArgumentException in Tinker as well.

I've also tried with the default ExampleConversation and it fails with the same error.

Ideas? I've searched the botman source code for calls or extensions to Carbon and adding a date property/method but I can't find one. I think it's something in Laravel potentially or with how Botman is beginning the serialization?

I'm also really new to Laravel so I'll try my best to keep up with responses. Thank you for your patience!

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.