mtproto | Telegram MTProto and its proxy in Go ( golang | Proxy library

 by   cjongseok Go Version: Current License: Apache-2.0

kandi X-RAY | mtproto Summary

kandi X-RAY | mtproto Summary

mtproto is a Go library typically used in Networking, Proxy, Docker applications. mtproto has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

MTProto === Telegram MTProto and proxy (over gRPC) in Go (golang). Telegram API layer: 71.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mtproto has a low active ecosystem.
              It has 150 star(s) with 22 fork(s). There are 19 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 7 open issues and 18 have been closed. On average issues are closed in 29 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mtproto is current.

            kandi-Quality Quality

              mtproto has 0 bugs and 0 code smells.

            kandi-Security Security

              mtproto has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              mtproto code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              mtproto is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              mtproto releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.
              It has 87859 lines of code, 2781 functions and 28 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mtproto
            Get all kandi verified functions for this library.

            mtproto Key Features

            No Key Features are available at this moment for mtproto.

            mtproto Examples and Code Snippets

            No Code Snippets are available at this moment for mtproto.

            Community Discussions

            QUESTION

            FILE_REFERENCE_EXPIRED at upload.getFile with inputPhotoFileLocation
            Asked 2022-Mar-25 at 04:06

            Can't get content from method upload.getFile using inputPhotoFileLocation, getting exeption FILE_REFERENCE_EXPIRED, readed lots of forums but cant get answer I'm using MTProto client on js

            ...

            ANSWER

            Answered 2022-Mar-25 at 04:06

            https://core.telegram.org/constructor/inputPhotoFileLocation
            You must pass type from message.media.photo.sizes in the thumb_size field

            That is, instead of JSON.stringify(message.media.photo.sizes.find(size => size._ == 'photoSizeProgressive')) you need to specify message.media.photo.sizes.find(size => size._ == 'photoSizeProgressive').type

            Source https://stackoverflow.com/questions/71603825

            QUESTION

            telegram api for USER rather than BOT
            Asked 2022-Feb-25 at 21:10

            So I heard you can create USER bots on TG, as in BOT-like bots but in USER accounts rather than BOT accounts.

            I've been searching for ages, cannot find any libs related to MTProto with good documentation on how one actually goes about doing this.

            I found the question: How do I use Telegram API without a bot?

            however its for another language.

            Please let me know if this is still possible, and if so, what libraries are useful for this - libraries that have docs preferably.

            ...

            ANSWER

            Answered 2021-Jul-24 at 17:39

            TdLib is what you looking for!

            TDLib (Telegram Database Library) is a cross-platform, fully functional Telegram client. We designed it to help third-party developers create their own custom apps using the Telegram platform.

            TdLib supports multiple languages and has a JSON interface for other languages. So don't worry about your programming language.

            It even abstracts whether the internet is connected or not, downloads multiple files based on priority, and so on. I strongly suggest you use TdLib.

            https://core.telegram.org/tdlib

            https://github.com/tdlib/td

            Source https://stackoverflow.com/questions/68507221

            QUESTION

            Tensorflow c_api decision forest savedModel loaded but status is not TF_OK
            Asked 2022-Feb-08 at 17:16

            I am using tensorflow decision forests. I trained my model using Python and saved the model with SavedModel format. Then for inference I am trying to load the model in C using tensorflow C_API. I found that for this task I need to load the decision forest inference.so file from Python package.

            You can use this command in Debian 10 to install Python package:

            pip3 install tensorflow-decision-forests

            After that in my program I load the inference.so file using TF_LoadLibrary. Then I load the model using TF_LoadSessionFromSavedModel.

            Here is the code

            ...

            ANSWER

            Answered 2022-Feb-08 at 17:16

            After a long time and didn't get an answer, I asked the question in the TensorFlow's forum and get the answer. It seems that the current version of TensorFlow has a problem with loading decision forests with C_API. So we can use the Yggdrasil library as discussed in the answer.

            Source https://stackoverflow.com/questions/70815249

            QUESTION

            Pyrogram: MTProto to read and copy telegram messages
            Asked 2022-Jan-08 at 10:43

            I'm using a pretty simple code to listen to two specific telegram input channels and copy all received messages to one target channel. I'm using Pyrogram, which implements MTProto, because I'm NOT the admin of the source channel, I'm just a reader - hence I couldnt use the regular BOT API, because my BOT wont get added to the source channels - instead, I need to rely on a User Bot API -> MTProto.

            Up until now, I was using Pyrogram 1.2.9 and it worked fine until maybe 4 weeks ago.

            My code is pretty simple and straightforward:

            ...

            ANSWER

            Answered 2021-Dec-30 at 14:00

            Yes. A new setting has been added called Restrict Saving Content (or content protection)

            Any channel owner can enable it which will prevent users from forwarding and even copying content including text.

            Source https://stackoverflow.com/questions/70509473

            QUESTION

            Analog searchChatsNearby method in MTProto
            Asked 2021-Nov-09 at 10:31

            there is a searchChatsNearby method in TDLib (https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1search_chats_nearby.html), because TDLib uses the MTProto protocol, there should be an analog in the protocol, but I can't find it in the scheme (https://core.telegram.org/schema/mtproto), how to understand what features of the MTProto scheme the searchChatsNearby method is implemented?

            ...

            ANSWER

            Answered 2021-Nov-09 at 10:31

            It's contacts.getLocated, which returns both users and groups

            Source https://stackoverflow.com/questions/69873570

            QUESTION

            How to migrate ConversationHandler module from Python-Telegram-Bot to Telethon
            Asked 2020-Jul-11 at 00:38

            Python-telegram-bot which is HTTP Telegram Bot API wrapper has telegram.ext.ConversationHandler module and its functionality is: "A handler to hold a conversation with a single user by managing four collections of other handlers."

            I'm migrating from this python-telegram-bot to Telethon MTProto API. And I have this ConversationHandler to manage conversation. How can I create any type of ConversationHandler in Telethon.

            Here is some little overview given by Telethon to migrate from python-telegram-bot. They use echobot2.py from ptb's examples. How can I migrate using this example conversationbot.py.

            ...

            ANSWER

            Answered 2020-Jul-11 at 00:38

            You can easily create what's known as a "finite state machine" (FSM) that is able to differentiate between the different states of a conversation a user can find themselves in.

            Source https://stackoverflow.com/questions/62245275

            QUESTION

            Non-blocking socket client and selectors
            Asked 2020-Jul-09 at 16:31

            As I'd like to try and implement a basic TCP connection with Telegram servers (using MTProto), I started reading about the Java NIO classes. However, I got "stuck" trying to understand the point of Selectors for a client.

            A selector supports key-based, non-blocking, multiplexed I/O. In other words, selectors enable you to perform I/O through multiple channels. (Java - The complete reference)

            Being that TCP messages, as a stream, are always ordered, and that I will only open a single socket connection (a single SocketChannel), what is the point of using Selectors? I think there is no point, am I right?

            If my self-answer is right, why not using blocking I/O directly?

            ...

            ANSWER

            Answered 2020-Jul-09 at 16:31

            NIO is basically used on the server side to handle large scale. I'll try to explain how a typical server works.

            A server has a requests queue, from which a polling thread consumes connections as a blocking dequeue operation (In Java, the default length of the requests queue is 50. It means if you try to initiate the 51st connection while the request queue is full, you'll get ConnectionRefused exception).

            A typical blocking implementation goes like this:

            1. Server accepts connection and puts it on the requests queue.

            2. A polling thread consumes connections from the head of the queue and dispatches it to a thread pool. The polling thread becomes free if the thread-pool queue is not full and continues consuming connections from the queue.

            3. At some point, all the threads in the thread-pool will become busy and the polling thread will get blocked while submitting more connections to the pool (as the thread-pool queue is a blocking queue).

            4. The requests queue starts filling up in the meantime. At some point, it'll get completely full and the server will no longer accept any connections.

            At this point, our server just can't scale anymore. Note that the "busy" threads in the pool might not be busy at all but just blocked - say for more data on the InputStream of the respective socket they are serving.

            Now consider this design:

            1. The polling thread consumes items from the head of the requests queue.

            2. It puts it on a unbounded list.

            3. Another thread continuously iterates over this list and checks if any activity has happened on the socket (read to read, ready to write, etc). If there is an activity, the socket is served. Note that these sockets operate in the NIO mode. That is, if there is no activity, our thread won't get blocked.

            4. The polling thread continues to submit connections to the list in the meantime as the list is unbounded. It does not get blocked anywhere (except while it is waiting for a new connection on the requests queue).

            In the above design, note that our scale is limited only by our system resources - namely how many connections the list hold. The response time will take a hit as there is just one thread servicing all the connections. You CPU consumption will be pretty high due to the mindless iteration. But you will still be able to connect to the server, unlike in the previous design.

            NIO basically solves this problem by using selectors.

            Source https://stackoverflow.com/questions/62818673

            QUESTION

            MTProto connection closed by server
            Asked 2020-Jul-05 at 20:48

            I am writing an MTProto client, however when I send a message my connection is closed. Under what conditions might MTProto close my connection?

            ...

            ANSWER

            Answered 2020-Jul-05 at 20:48

            MTProto servers will close your connection (under TCP at least) if they can't understand what you've sent it; messages sent that have some incorrect parameter will typically receive a reply indicating parameters were incorrect but messages whose composition is fundamentally wrong, e.g: sending the transport code with each message instead of just the first will lead to the connection being closed. Check the code that handles the transport layer for correctness against https://core.telegram.org/mtproto/transports#tcp

            Source https://stackoverflow.com/questions/62746172

            QUESTION

            Connecting MTProto Proxy to bot Telegram.Bot DLL
            Asked 2020-Jan-03 at 01:30

            Telegram is banned in my country and i can't connect the bot to Telegram API without a VPN I wanted to run the bot with MTProto Proxy

            MTProtoProxy Format : host , port , secret

            My code to connect to telegram api is (with Telegram.Bot library)

            ...

            ANSWER

            Answered 2020-Jan-03 at 01:30

            That cannot be done because Bot API uses https requests to communicate while MTProtoProxy proxies are meant for MTProto API (used by telegram clients) which is different from the Bot API.

            You would need to use a normal HTTP/socks proxy in order to avoid the ban which can be found at this page https://telegrambots.github.io/book/4/proxy.html

            Source https://stackoverflow.com/questions/59558937

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mtproto

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cjongseok/mtproto.git

          • CLI

            gh repo clone cjongseok/mtproto

          • sshUrl

            git@github.com:cjongseok/mtproto.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Proxy Libraries

            frp

            by fatedier

            shadowsocks-windows

            by shadowsocks

            v2ray-core

            by v2ray

            caddy

            by caddyserver

            XX-Net

            by XX-net

            Try Top Libraries by cjongseok

            dag.js

            by cjongseokJavaScript

            apollo-sample

            by cjongseokJava

            go-istio-utils

            by cjongseokGo