Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow consumer to use TelegramBot instance outside #13

Closed
kshashov opened this issue Apr 5, 2022 · 1 comment
Closed

Allow consumer to use TelegramBot instance outside #13

kshashov opened this issue Apr 5, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@kshashov
Copy link
Owner

kshashov commented Apr 5, 2022

Allow consumer to use TelegramBot instance outside.

The best option is to register TelegramBot instances in the Spring context but it is enough to just add a new builder methods into TelegramBotGlobalProperties.Builder

@kshashov kshashov self-assigned this Apr 5, 2022
@kshashov kshashov added the enhancement New feature or request label Apr 5, 2022
@kshashov
Copy link
Owner Author

kshashov commented Apr 5, 2022

Now it is possible to get the TelegramBot instance in TelegramBotGlobalPropertiesConfiguration:

    @Override
    public void configure(TelegramBotGlobalProperties.Builder builder) {
        builder.processBot(token, bot -> {
            bot.execute(new SendMessage(354681036, "test"));
        });
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant