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

Pass Telegram API to plugins #141

Open
ufocoder opened this issue Oct 3, 2017 · 2 comments
Open

Pass Telegram API to plugins #141

ufocoder opened this issue Oct 3, 2017 · 2 comments

Comments

@ufocoder
Copy link
Contributor

ufocoder commented Oct 3, 2017

I investigate the code of project and I think it will be better if instead of creating telegram API
https://github.com/crisbal/Telegram-Bot-Node/blob/3677ee4cad2ede0ebae07422e5579472eed33d0c/src/Bot.js#L26
and then binding it's method to master plugin
https://github.com/crisbal/Telegram-Bot-Node/blob/3677ee4cad2ede0ebae07422e5579472eed33d0c/src/PluginManager.js#L22
we will should pass telegramAPI instance to plugins directly, it will be transparently and plugins will be easily to test

@CapacitorSet
Copy link
Collaborator

What is the advantage to doing this? The interface will be just as powerful but more verbose, since plugins can't use this.sendMessage but must use this.api.sendMessage instead.

@ufocoder
Copy link
Contributor Author

ufocoder commented Oct 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants