sdidyk / mtproto Goto Github PK
View Code? Open in Web Editor NEWMTProto implementation in Golang
MTProto implementation in Golang
I've tried many times.
telegram auth 7985xxxxxxx
Fails with single line "SendRoutine: use of closed network connection"
~/.telegram_go - contains 304 bytes
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
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
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?
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
Is there way to handle and store in arbitrary database the sessions of multiple users?
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)
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?
Anyone knows the limits msg/second or addContact/second?
Because i'm getting this error when sending 200-300 messages in few seconds.
At: https://github.com/sdidyk/mtproto/blob/master/tl_encode.go#L121
The "append" operations inserts 512 bytes to the current buffer, when the correct thing would be including only 8 bytes (vectory type identification and vector length).
I founded the error while trying to call TL_contacts_importContacts.
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
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
}`
https://github.com/AmarnathCJD/gogram
API Layer 147
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.