gram-js / gramjs

NodeJS/Browser MTProto API Telegram client library,
MIT License
1.22k stars 175 forks source link

How to use Api.phone.ConfirmCall ? #290

Open mathysRedTeam opened 2 years ago

mathysRedTeam commented 2 years ago

I'm done a phone.RequestCall and so now i'm trying to exchange the encrypting keys with the confirmCall but when I try it return this error:

RPCError: 400: DH_G_A_INVALID (caused by phone.ConfirmCall)

here is the code:

 const resultB = await client.invoke(new Api.phone.ConfirmCall({
    peer: new Api.InputPhoneCall({
      id: result.phoneCall.id,
      accessHash: result.phoneCall.accessHash
    }),
    gA: Buffer.from("some byte"),
    keyFingerprint: 5673894314823,
    protocol: new Api.PhoneCallProtocol({
      minLayer: 93,
      maxLayer: 93,
      udpP2p:true,
      libraryVersions: ["2"],
    }),
    }));
console.log(resultB); // prints the result
painor commented 2 years ago

What are you trying to do ? if you are trying to do voice calls you'll need to use the tgcall library

mathysRedTeam commented 2 years ago

What are you trying to do ? if you are trying to do voice calls you'll need to use the tgcall library

Ok, I'm trying to create a userbot (not a bot) who can call users in private, if it is possible can you send me a link to this library please ?

rojvv commented 2 years ago

This issue is really out of the scope in my opinion. It is your job to investigate about those methods, maybe by reading the sources of official clients and libraries. You cannot get any help by opening an issue here.

mathysRedTeam commented 2 years ago

This issue is really out of the scope in my opinion. It is your job to investigate about those methods, maybe by reading the sources of official clients and libraries. You cannot get any help by opening an issue here.

Ok but there is a method called phone.ConfirmCall in your code and when I try to use it I get this error

RPCError: 400: DH_G_A_INVALID (caused by phone.ConfirmCall)

So why is that happenning ?

rojvv commented 2 years ago

@mathysdevnode Read https://github.com/gram-js/gramjs/issues/290#issuecomment-1079153887. Sorry if I’m a bit awkward, but it’s the only thing I can say.

mathysRedTeam commented 2 years ago

@mathysdevnode Read #290 (comment). Sorry if I’m a bit awkward, but it’s the only thing I can say.

You're not realy helping...