getG<G extends BotData> method
Get other types of chatbot data from the collector.
-
{identifier} is the identifier of the data.
-
{G} is the type of the data. This is useful if you want to get the data back as a specific type. If not specified, the data will be returned as BotData.
This method should only be used for data that is not a bot, intent, or object or if you want to collect more than one bot at a time. It requires you to specify and memorize the identifier of the data.
Implicit collecting is not supported for this method. If the data with the specified identifier is not collected, null will be returned.
Implementation
G? getG<G extends BotData>(String identifier) {
if (_generals.containsKey(identifier)) {
return _generals[identifier]! as G;
} else {
return null;
}
}