Skip to content

tru2dagame/integram

 
 

Repository files navigation

Integram 2.0

Framework and platform for integrating services into Telegram using official Bot API

GoDoc CircleCI

Screencast

How to use Integram

Just use this links to add integrations you are interested in

Not found you favorite service? 🤘 Vote for it Running Integram on your side

You can run Integram on your own server.

  • Create the main.go file (example is below)
  • Use your own bot created with Botfather.
  • For the each service you are want to use you need to create an OAuth client(application) in it
  • Set environment variable GOPATH to the directory contains main.go file
  • Run go get github.com/requilence/integram
  • Specify environment variables:
    • INTEGRAM_PORT - if set to 443, integram.crt and integram.key must be presented in the root
    • INTEGRAM_BASE_URL - the base URL the host accessible with, f.e. https://integram.org
  • Run go run main.go or go build && ./integram
  • In order to run test with go test you need to set some environment variables:
    • INTEGRAM_TEST_BOT_TOKEN - to perform some non-emulated Telegram tests
    • INTEGRAM_TEST_USER - Telegram user id that have a dialog with this bot

main.go example

package main

import (
	"github.com/requilence/integram"
	"github.com/requilence/integram/services/trello"
	"github.com/requilence/integram/services/gitlab"
)

func main() {
	integram.Debug=true
	
	integram.Register(
        trello.Config{
            integram.OAuthProvider{
                ID:     "TRELLO_APP_KEY",
                Secret: "TRELLO_APP_SECRET",
            },
        },
        "BOT_TOKEN_PROVIDED_BY_@BOTFATHER",
    )

    integram.Register(
        gitlab.Config{
            integram.OAuthProvider{
                ID:     "GITLAB_APP_ID",
                Secret: "GITLAB_APP_SECRET",
            },
        },
        "BOT_TOKEN_PROVIDED_BY_@BOTFATHER",
    )

		
	integram.Run()
}

Dependencies and vendor directory

All dependencies come with package itself and may be modified directly (see the Third party libraries)

Requirements

Go 1.5+, MongoDB 3.2+ (for data), Redis 3.2.0+ (for jobs queue)

Contributing

Feel free to send PRs. If you want to contribute new service integration, please create the issue first. Just to make sure developing is not already in progress.

Third party libraries

* - package source is modified

License

Code available on GPLV3 license

Analytics

About

Integrate Telegram into your workflow – https://integram.org

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%