chatterbox 1.0.1
chatterbox: ^1.0.1 copied to clipboard
Framework to build dialog flows for Telegram Bots
Chatterbox is a simple framework to build multi level Telegram Bot dialog flows. It is build around televerse library.
Features #
Allows to process different kind of messages from user and reply to them within the given context
Getting started #
Can be used with both webhook and polling.
Usage #
Webhook with Cloud Functions #
@CloudFunction()
Future<void> function(Map<String, dynamic> updateJson) async {
setTranslations(translations); //todo this is rubbish
SharedDatabase.initialize();
final store = ChatterboxStoreProxy(SharedDatabase.createDialogDao());
final flows = <Flow>[
LoginFlow(SharedDatabase.createTokenDao()),
];
Chatterbox(SharedConfig.botToken, flows, store).invokeFromWebhook(updateJson);
}