leaf_bot

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 9 Imported by: 0

README

Leaf (pocket) bot

LeafBot - is a Telegram bot, which allows you to save link in the application Pocket. Leafbot is a client for Pocket.

Used libraries:

Implement

First at all, when the bot started, bot generates the link with unique request token, which created and stored in DB when user started the bot, and send it to the user, at the click of the link authorization process starts.

To implement user authorization, together with the bot, an HTTP server is started on port 80. HTTP server is using for creating access token, put it in the DB and redirecting from Pocket after successful user authorization.

After the authorization process, user can save links to Pocket by LeafBot.

How to use

For local using you can clone this repository via git:

git clone github.com/yalagtyarzh/leaf_bot

or install it via go:

go install github.com/yalagtyarzh/leaf_bot

After, you need to:

  • Build a program with the pre-registred enviroment dependencies using Docker:
docker build -t <build-name> .

and run it like that:

docker run -e TOKEN -e CONSUMER_KEY -e AUTH_SERVER_URL -d \ --name <container-name>

You can use Makefile for building docker image and running docker container (Makefile must be installed).

  • Uncomment os.Setenv functions in config.go and enter telegram bot token instead of YourAwesomeBotToken, enter Pocket consumer key instead of YourAwesomePocketToken and enter vaild authorization server instead and build program using go tools or Makefile (Makefile must be installed) (not recommended).
make run

After these steps, the bot should start (hopefully Kappa).

Stack:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL