-
Notifications
You must be signed in to change notification settings - Fork 173
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
[WIP] Separate relevant parts into their own "mixin" classes / continue adding missing pieces #25
Conversation
At least I think so
No major changes
examples/getMe.js
Outdated
@@ -11,4 +11,5 @@ const { TelegramClient } = require('../gramjs') | |||
await client.connect() | |||
|
|||
console.log(await client.getMe()) | |||
await client.disconnect().then(() => process.exit(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make it only work in node environments and not in browsers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, I only had Node in mind for that example
Good PR. Although I am not familiar with Mixin so I'm going to assume it's just a hack to do multiple inheritances as python does. I'm going to test it more and give some feedbacks. |
Yeah it's basically a hack, although one that works pretty well. The standard way to do mixins is to just use |
* Update eslint config * Fix brace-style in eslint config * Fix prefer-const * Lint files
I'm closing this in favor of #51 |
So this is going to be a big one. I just wanted to get it in as a PR so I can get feedback on it as I work. It's nowhere near finished yet, but it is at least testable in many cases. So far it entails two main pieces:
TelegramClient
apart into smaller, more manageable pieces. This is inspired by Telethon and handled in a very similar way (which I was surprised is actually very possible with JavaScript).I'm definitely open to comments. Yes, this is basically just a straight port of the way Telethon does things, no I am not creative enough to come up with my own "unique" way of handling things. Telethon just does things very well and I didn't see a reason to diverge too much. So props to Lonami 😄