Giter Site home page Giter Site logo

mtproto's People

Contributors

hugozhu avatar sdidyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mtproto's Issues

create ImportContact

When i try to add ImportContact api i get this error:

RPC: mtproto.TL_rpc_error{error_code:400, error_message:"INPUT_CONSTRUCTOR_INVALID"}

Here is my code:

`func (m *MTProto) AddContact(client_id int64, name string, surname string, number string) error {
resp := make(chan TL, 1)
fmt.Println("Trying to add contact:", name, surname, number)
m.queueSend <- packetToSend{
TL_contacts_importContacts{
[]TL{TL_inputPhoneContact{client_id, number, name, surname}},
TL_boolFalse{}},
resp}

x := <-resp
list, ok := x.(TL_importedContact)

fmt.Println("IMPORTED:", list)
if !ok {
	fmt.Println("Erro:", x)
	return fmt.Errorf("RPC: %#v", x)
}

return nil

}`

createGeoChat

Hey, you're doing an awesome job!

I'm trying to use TL_geochats_createGeoChat but I'm getting a weird error, in my opinion the answer schema is still disabled but I'm asking your opinion to confirm my thesis.

This is what I get:

leaf:telegram dunric$ ./telegram creategeochat
RPC: mtproto.TL_rpc_error{error_code:400, error_message:"INPUT_METHOD_INVALID"}
leaf:telegram dunric$

This is my piece of code:

func (m *MTProto) CreateGeoChat() error {
    var inputGeoPoint = TL_inputGeoPoint{44.4931088, 11.3377388}

    resp := make(chan TL, 1)
    m.queueSend <- packetToSend{
        TL_geochats_createGeoChat{
            "My Venue",
            inputGeoPoint,
            "My address",
            "My foursquare URL",
        },
        resp,
    }
    x := <-resp
    _, ok := x.(TL_geochats_statedMessage)
    if !ok {
        return fmt.Errorf("RPC: %#v", x)
    }

    return nil
}

Any idea?

Auth is not working

root@mishanon:/prj/prj# telegram auth 890********
Got: mtproto.TL_auth_sentAppCode
root@mishanon:/prj/prj# ls

Telegram sent code, but the program quit without possibly enter that code.

root@mishanon:/prj/prj# go version
go version go1.15.2 linux/amd64

Trying to revive project and add new layer

I started working on this project a while ago in an attempt to get it up and running again. I have encountered a problem though. After I made a script to turn tl schemes into json, I took the layer 45 schema from tgl. And of course there are a lot of changes from layer 23 to 45, so I have been encountering some issues. The main issue is that Process function seems to be missing a few cases as it returns null when i try to connect. Specifically this happens which the Connect function sends the TL_init_connection message.
In layer 23, this is what is recieved when the program starts

  • TL_msg_container containing TL_new_session_created and TL_msgs_ack which both process perfectly
  • TL_rpc_result which contains TL_config as the obj

In layer 45 the program does not seem to find TL_config and just leaves it as nil, which causes the program to never "connect" and having it crash on start when it tries to cast it to a TL object but is instead met with nil and panics.

I have pushed the exact code that i am using to my repo so that you can test it.
And ofcourse i somehow put them all into another directory
Paging @sovietspaceship @hugozhu @beautyfree

Deadlock after reconnect (changing datacenter)

the code will be blocked for ever in reconnect method, after getting PHONE_MIGRATE_ or NETWORK_MIGRATE_.

It is waiting for 3 updates on allDone channel, in which 2 of them never arrive (for sendRoutine and sendRoutine)

Err: FLOOD_WAIT

Anyone knows the limits msg/second or addContact/second?

Because i'm getting this error when sending 200-300 messages in few seconds.

Add new contact

Hi @sdidyk
I'm developing a client of telegram.cli, everything is ok, but I can't implement method to adding new contact to existing contact list.
Please help me to do that
Regards, Nima

Send Big File

Hi!
Thanks for you library!
I try send file big file to server. I split file on chunks and send with this method:

TL_upload_saveBigFilePart{
	file_id:          id,
	file_part:        int32(i),
	file_total_parts: parts,
	bytes:            bb,
},

But after last chunk, I receive error from readRoutine:

ReadRoutine: EOF

Who knows what is problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.