fduch2k / bots-framework

Golang framework to build multilingual bots for messengers (Telegram, Facebook Messenger, Skype, Line, Kik, WeChat) hosted on AppEngine, Amazon, Azure, Heroku or standalone

Home Page:https://debtstracker.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strongo Bots Framework

A Go language framework to develop bots for messengers.

Reasons to use:

  • Same code can work across different messenger (Telegram, Facebook Messenger, Viber, Skype, Line, Kik, WeChat, etc.)
  • You can tune your code to a specific messenger's APIs.
  • i18n & l10n support (multilingual)
  • Can be hosted in cloud or just as a standard Go HTTP server. Supports AppEngine standard environment.
  • It's fast

Conitious Integration

Build Status

Usage

func InitBot(httpRouter *httprouter.Router, botHost bots.BotHost, appContext common.DebtsTrackerAppContext) {

	driver := bots.NewBotDriver( // Orchestrate requests to appropriate handlers
		bots.AnalyticsSettings{GaTrackingID: common.GA_TRACKING_ID}, // TODO: Refactor to list of analytics providers
		appContext,                                       // Holds User entity kind name, translator, etc.
		botHost,                                          // Defines how to create context.Context, HttpClient, DB, etc...
		"Please report any issues to @DebtsTrackerGroup", // Is it wrong place? Router has similar.
	)

	driver.RegisterWebhookHandlers(httpRouter, "/bot",
		telegram_bot.NewTelegramWebhookHandler(
			telegramBotsWithRouter, // Maps of bots by code, language, token, etc...
			newTranslator, // Creates translator that gets a context.Context (for logging purpose)
		),
		viber_bot.NewViberWebhookHandler(
			viber.Bots,
			newTranslator,
		),
		fbm_bot.NewFbmWebhookHandler(
			fbm.Bots,
			newTranslator,
		),
	)
}

Sample bots built with Strongo Bots Framework

The best way to learn is to see examples of usage. Here is one:

  • DebtsTracker.io — a bot & a reminder service that helps to track your debts & credits. Sends automated reminders to you & your debtors (in messenger, email, SMS).

We would be happy to place a link to your example / bot that is implemented using this framework.

Go API libraries used by the framework to talk to messengers

You can use any Bot API library by implementing couple of simple interface but the framework comes with few buildins:

Contributors

Press

There are no articles about the Strongo Bots Framework just yet. Send us a link if you find such.

Licensed under Apache 2.0 license

About

Golang framework to build multilingual bots for messengers (Telegram, Facebook Messenger, Skype, Line, Kik, WeChat) hosted on AppEngine, Amazon, Azure, Heroku or standalone

https://debtstracker.io/

License:Apache License 2.0


Languages

Language:Go 100.0%