1.0.0 • Published 3 years ago

tghive v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Telegram Hive

The telegram hive library allows saving state and memorization for telegram bots besides real-time message passing through events to provide communication between multiple bots.

The hive is implemented in MongoDB and the bot uses the telegram bot api through the node-telegram-bot-api library

API

The tgHive API provides two main methods, one for starting just a communication gateway with the whole hive, another one that also instantiates a bot.

const { hive, db } = openHive({ db: ... }); 

const { bot, hive, db } = hiveBot(botName, { db: ... });
//                                ↑ the name of the bot stored at the DB

The DB input in the configuration is not the one at the output. The input one is a MongoDB Database, the returned one a instance with the models created as collections inside mongo database.