You can already create api keys and interact with Flarum from a script relatively easily I guess.
But there are no webooks/polling feature by default so you either need to build your chatbot as an extension or create an extension that adds those hooks (and maybe even PR it to core !)
I'm not sure how you imagine "asking something to the bot" ? You think of integrating with a private discussion extension like Byobu ?
You can of course build all of that as an extension.