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

Accessing client object from callbacks #21

Open
vranki opened this issue Jan 21, 2019 · 1 comment
Open

Accessing client object from callbacks #21

vranki opened this issue Jan 21, 2019 · 1 comment
Assignees

Comments

@vranki
Copy link

vranki commented Jan 21, 2019

Is there a way to access the bot.client variable from the callback functions somehow? If so, it would be useful to document it.

If not, it should be made possible. Perhaps add the bot or the client as callback parameter?

Client is required for example for file upload.

@shawnanastasio
Copy link
Owner

As it stands, callbacks aren't passed the bot or client. I hadn't considered that it was necessary for something like file upload, but now that you mention it, the functionality should certainly be added.

My main concern is preserving API compatibility with existing callbacks. Introducing a client parameter would break compatibility, unless some cleverness was used. Perhaps attempting a 3 parameter callback with a try statement and on failure falling back to 2 parameters? I'll give it some thought and provide updates here.

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