gramjs
gramjs copied to clipboard
How To Listen For Phone Events Gram-JS
Hello! Maybe I can be wrong, but have I missing event for calls handling event?
Let me explain - I have a code, that calls a user and then I wan'to to play an audio file, For now all I have is, hope you can get any tips, ty
import "dotenv/config";
import { Api } from "telegram";
import { client } from "./client";
import { getGAHash } from "./utils";
(async () => {
await client.connect();
const doCall: Api.phone.PhoneCall = await client.invoke(
new Api.phone.RequestCall({
userId: "SomeTestUser",
randomId: Math.floor(Math.random() * 0x7ffffffa),
gAHash: await getGAHash(),
protocol: new Api.PhoneCallProtocol({
minLayer: 93,
maxLayer: 93,
libraryVersions: [],
udpP2p: true,
udpReflector: true,
}),
})
);
console.log(doCall);
})();
UPD: I have found some docs, but I don't know how that helps me https://gram.js.org/beta/classes/Api.PhoneCallAccepted.html