Giter VIP home page Giter VIP logo

Comments (7)

sdidyk avatar sdidyk commented on August 28, 2024
  1. check seriazliation of type double :)
  2. may be telegram guys blocks those geochats in layer 23? i see "Type schema is not available in the selected layer" in some methods/objects like https://core.telegram.org/type/geochats.StatedMessage

from mtproto.

marco-fabbri avatar marco-fabbri commented on August 28, 2024
  1. i tried using getRecents (https://core.telegram.org/method/geochats.getRecents) and i'm having the same error, that points to your 2
  2. i had the same feeling reading that period, that's why i contacted telegram support but i didn't receive anything useful

my point 3 is: we're actually authenticating with our gsm number, what about using API keys? is it the same?

from mtproto.

marco-fabbri avatar marco-fabbri commented on August 28, 2024

Forget point 3 😛

I tried to create e normal chat (group) and i'm getting erorr 400 again. Do you get what i am doing wrong?

My error:

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

My piece of code:

func (m *MTProto) CreateChat() error {
    resp := make(chan TL, 1)
    m.queueSend <- packetToSend{
        TL_messages_createChat{
            []TL{TL_inputUserContact{2921643}},
            "My Chat",
        },
        resp,
    }
    x := <-resp
    _, ok := x.(TL_messages_statedMessage)
    if !ok {
        return fmt.Errorf("RPC: %#v", x)
    }

    return nil
}

from mtproto.

sdidyk avatar sdidyk commented on August 28, 2024

I've got same result :( I think layer 23 is kinda deprecated for the TG servers, Durov has chosen offical clients for TG and the quality support for public API is no more needed.

from mtproto.

marco-fabbri avatar marco-fabbri commented on August 28, 2024

I had this answer from BotSupport:

Regarding your question, I want to let you know that geochat are just part of the old api layers, they are not any more present, so I don't recomend you to use them.

What do you think about the TL_messages_createChat instead?

from mtproto.

sdidyk avatar sdidyk commented on August 28, 2024

With fixed "Vector bug" it's working now.
For TL_messages_createChat try

        TL_messages_createChat{
            []TL{TL_inputUserSelf{}, TL_inputUserContact{132597}},
            "My Chat",
        },

Second peer must be your contact or you should get USERS_TOO_FEW error response.

from mtproto.

ngopher avatar ngopher commented on August 28, 2024

Hi @sdidyk
I am using your mtproto code for developing an sapmle app for only add contact and send message.
I had wrote all methods successfully, but I can not implement method for add contact!
there is the method: please help me to complete it. I have error : INPUT_CONSTRUCTOR_INVALID , too.
/////////////////////////////////
func (m *MTProto) Contacts_ImportContacts(in []TL) TL_contacts_importedContacts {
resp := make(chan TL, 1)
m.queueSend <- packetToSend{
TL_contacts_importContacts{in, TL_boolFalse{}}, resp}
x := <-resp
switch r := x.(type) {
case TL_contacts_importedContacts:
return r
default:
log.Println(x)
}
return TL_contacts_importedContacts{}
}
///////////////////////////////////////////////
and this is call of method:
func importContact(c *gin.Context) {
m, err := mtproto.NewMTProto(os.Getenv("HOME") + "/.telegram_go")
if err != nil {
fmt.Printf("Create failed: %s\n", err)
os.Exit(2)
}
_ = m.Connect()
var NewContact mtproto.TL_inputPhoneContact
NewContact.Last_name = ""
NewContact.First_name = ""
NewContact.Phone = "0989212049236"
NewContacts := []mtproto.TL{NewContact}
x := m.Contacts_ImportContacts(NewContacts)
c.JSON(200, gin.H{"status": x})

}

from mtproto.

Related Issues (15)

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.