NAME

Telebot::Plugin::Hooks - Defines hooks which initialize application environment.

DESCRIPTION

Telebot::Plugin::Hooks - plugin which makes required for Telebot application actions at the beginning and in the end of work.

When hypnotoad server of application starts these hooks initialize Minion workers, define route for Telegram webhook and inform Telegram about created webhook.

When hypnotoad server stopped hooks kill started with hypnotoad Minion workers but not which ones which were started in other way.

So main purpose of this module is prepare application to interact with Telegram via webhook and process Telegram updates via minion tasks.

METHODS

Telebot::Plugin::Hooks inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

my $tg = $plugin->register(Mojolicious->new);

Register plugin in Mojolicious application and define hooks.

COPYRIGHT AND LICENSE

Copyright (C) 2022, Igor Lobanov. This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.

SEE ALSO

https://github.com/igorlobanov/telebot, Mojolicious::Guides, https://mojolicious.org, https://core.telegram.org/bots/api.