Jhon Caylog
Jhon Caylog

Reputation: 503

Microsoft Bot Builder (chat bot) error

The Bot State API is deprecated. Please refer to https://aka.ms/I6swrh for details on how to replace with your own storage. Anyone know what is the problem and how to configure? Is it local storage problem ?image screenshot

Upvotes: 0

Views: 1161

Answers (2)

Ben Swinburne
Ben Swinburne

Reputation: 26467

In the previous versions of botbuilder microsoft provided a state api for bots. The state api managed the state of the bot as you might expect; things like the user data, the conversation data, the dialog data etc.

They have since deprecated this API and provided a way which you can implement your own storage adapters, or indeed us available packages to do so.

The botbuilder module provides an in memory storage which obviously is fine while the bot is running but will be lost if the bot crashes and isn't suitable if you intend to load balance the bot across multiple machines.

I tend to use the in memory storage for local development and in production switch it out with a different adapter.

const bot = new builder.UniversalBot(connector, [..waterfall steps..])
   .set('storage', new builder.MemoryBotStorage())

However, there are other storage adapters available

The Microsoft package botbuilder-azure offers table storage, CosmosDB storage and SQL storage.

I tend to use the following package botbuilder-storage with the DynamoDB adapter. It also offers Redis and MongoDB adapters.

State management is also documented pretty well here

https://learn.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-state

Upvotes: 1

Geander
Geander

Reputation: 388

Need fix this by manually setting the memory storage:

var bot = new builder.UniversalBot(connector, {
    storage: new builder.MemoryBotStorage()
});

Reference: https://github.com/Microsoft/BotBuilder/issues/3785

Upvotes: 0

Related Questions