grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.21k stars 111 forks source link

Feature request: Telegram MTProto API support #35

Closed mcpeblocker closed 2 years ago

mcpeblocker commented 2 years ago

I am new to the grammY framework. To date, I have been using the TelegrafJS framework. The grammY documentation is very well written and understandable. After reading it, I realized that grammY, like Telegraf, only has support for the Telegram HTTP Bot API. If grammY itself had support for the Telegram MTProto API, it would open the door to great opportunities for users!

I would like to ask you to add support for Telegram MTProto at some point.

KnorpelSenf commented 2 years ago

I understand that people want to build user bots. However, grammY is tailored towards the Bot API. I cannot think of any part of the code that could be shared between the projects.

In other words, supporting MTProto would require a completely distinct code base. I'm not sure it makes sense to integrate these two things.

I'm open to see someone contribute a plugin that implements all the tedious MTProto things. It may make sense to rely on grammY as the main foundation of a bot, and have a few interesting methods supported by a plugin (full API coverage would likely be superfluous).

What is your reason not to use @gram-js?

What features of the MTProto API would you like to use that do not exist on the Bot API?

mcpeblocker commented 2 years ago

I understand that people want to build user bots. However, grammY is tailored towards the Bot API. I cannot think of any part of the code that could be shared between the projects.

In other words, supporting MTProto would require a completely distinct code base. I'm not sure it makes sense to integrate these two things.

I'm open to see someone contribute a plugin that implements all the tedious MTProto things. It may make sense to rely on grammY as the main foundation of a bot, and have a few interesting methods supported by a plugin (full API coverage would likely be superfluous).

What is your reason not to use @gram-js?

What features of the MTProto API would you like to use that do not exist on the Bot API?

It is clear that support for the MTProto API will require a lot of work and a lot of changes will be made for this. However, I think it will be very useful for many users even if you add this feature to future plans.

The reason I don’t use Gram-JS is because its documentation is hard to understand and seems like an alien language to beginners like me.

This feature is available in a number of libraries in the python programming language. Unfortunately, I could not find such a convenient and easy-to-understand framework in Javascript.

I intended to create a framework that could work with the MTProto API and be easy to use. However, when I recently got acquainted with grammY, I was very envious of its convenience and ease of understanding. Seeing this, I thought it would be much easier for others when grammY had this feature, and I wanted to know if you have this plan.

If you haven’t thought about this yet, I would be very happy to create a plugin that works with the MTProto API. But I can’t say I have enough knowledge for that. Now that I have thoroughly researched the libraries in the python programming language, I aim to develop a plugin for maximum convenience. I don't know how long it will take, but hopefully I will send PR to this repository related to the new plugin :)

KnorpelSenf commented 2 years ago

I am not sure I would have had the resources to develop a library of grammY's quality for something as extensive as the MTProto API, but it's definitely cool if you would get started with this task!

I am happy to add you to the grammY organisation on GitHub and give you the necessary npm publish rights if you want the plugin to be official rather than third-party.