eleksir f1ad32d5ae Add migration scripts and doc.
When I move bot from perl-5.30.0 to perl-5.32.1 I encounter with BDB0091
DB_VERSION_MISMATCH error And it looks like I have to export essential
data on older perl to some portable format and then import it on newer
perl environment.
2021-07-05 16:56:01 +03:00
2021-07-05 16:56:01 +03:00
2021-07-02 16:03:20 +03:00
2021-07-02 16:03:20 +03:00
2020-10-30 18:14:00 +03:00
2021-07-02 16:03:20 +03:00
2021-07-05 16:56:01 +03:00
2021-03-12 15:07:50 +03:00

Aleesa-Telegram-bot - Telegram chatty bot

About

It is based on Perl modules Telegram::Bot and Hailo as conversation generator.

I have to fork Telegram::Bot and update it according to features appeared in Telegram Bot API v5. Also, I decide to rename it to avoid collision in the future, now it is Teapot::Bot and is bundled with bot. When lib becomes mature enough, maybe I release it separately.

Bot config located in data/config.json, sample config provided as data/sample_config.json.

Bot can be run via bin/aleesa-telegram-bot and acts as daemon (double fork() and detaches stdio).

Installation

In order to run this application, you need to "bootstrap" it - download and build all required dependencies and libraries.

You'll need perl-5.18 or newer, "Development Tools" or similar group of packages, perl, perl-devel, perl-local-lib, perl-app-cpanm, sqlite-devel, zlib-devel, openssl-devel, libdb4-devel (Berkeley DB devel), make.

After installing required dependencies it is possible to run:


bash bootstrap.sh

and all libraries should be downloaded, built, tested and installed.

Running

This bot does not ultilize webhooks, so in order to run it only well internet connection is requied, no public-available ip address is needed.

Additional Settings to be performed in order to run bot as it designed

There are some "plugins" that requires registration on thrird party services and API keys and secrets in order to work.

OpenWeatherMap

You should register, login and create api key. Free plan have all required features to run this "plugin".

Once key is created you should put it in config.json under openweathermap section as appid. Thats it.

It is still impossible to disable this plugin, but "I'm working on it".

Imgur

This plugin "just exists" and is actually used nowhere around the code. Anyway, to make use of it besides registering apropriate handler in code, you should sign in imgur and get access token.

Actually at this time this "plugin" can be stub-ed with default config values.

Anyway, to fetch access token you should login and perform registration of your app. Then you should authorise your app according to this manual. Or this one.

Flickr

This "plugin" is really used to implement random picture link retrival plugins.

There is helper script in bin/flickr_init.pl that helps to get all required keys and secrets from flickr api.

Before using it bot must be bootstrapped via bootstrap.sh.

Login and create an app in your flickr account. Then logout flickr account. (It is required in order to properly get "verfier" parameter later).

Put your app key and secret to config.json. Ensure that "verifier" parameter in Flickr-related part of config either absent or commented out.

Run bin/flickr_init.pl first time and follow on screen instuctions - copy and paste given link to browser login to flickr account adn yo'll be redirected to example.com. Check address bar in browser to get so-called "verifier", put it in config.json. Then run bin/flickr_init.pl again to store API access token in db under data/image directory (in default config). You're done.

Description
No description provided
Readme 674 KiB
Languages
Perl 99.9%
Shell 0.1%