Closed sayem314 closed 2 years ago
I haven't faced this. Can you show me your error or something?
It simply doesn't work. The user won't join but there is no error being generated.
This doesn't make any sense. Are you trying to join the call using the same account?
Yes. When I'm in the group, everything works fine. I did create a test group of my own so I am sure I am not restricted.
NVM. There was an error message, I tried again now and this error occurred.
Error: Could not find the input entity for {"channelId":"xxx_channel_id_here"}.
Please read https://docs.telethon.dev/en/latest/concepts/entities.html to find out more details.
at Object.getInputEntity (/home/sayem/workflow/projects/TelegramGroupTools/node_modules/gramjs/client/users.ts:339:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.getFull (/home/sayem/workflow/projects/TelegramGroupTools/node_modules/gram-tgcalls/lib/chats.js:6:25)
at async TGCalls.tgcalls.joinVoiceCall (/home/sayem/workflow/projects/TelegramGroupTools/node_modules/gram-tgcalls/lib/index.js:61:34)
at async TGCalls.start (/home/sayem/workflow/projects/TelegramGroupTools/node_modules/tgcalls/lib/index.js:70:35)
at async GramTGCalls.stream (/home/sayem/workflow/projects/TelegramGroupTools/node_modules/gram-tgcalls/lib/index.js:102:13)
error Command failed with exit code 1.
Note that when I'm in the group it works without issue. No code changes were made.
Wait I think it's not an issue with tgcalls but mentioned below. GetFullChannel
must be called to get details and then use on tgcalls to connect.
const {fullChat}: Api.messages.ChatFull = await client.invoke(new Api.channels.GetFullChannel({channel})); // here
if (fullChat.call) {
try {
const tgcalls = new GramTGCalls(client, fullChat);
tgcalls.stream({readable}, undefined, {
join: {
joinAs: 'me',
muted: true,
videoStopped: true,
},
});
} catch (err: any) {
console.error(signale.error(err.message));
}
}```
Solved now. Fixed via retrieving channel details with Api.channels.GetChannels
.
In desktop and mobile apps, it's possible to do so but not with this library. In order to join a voice chat, it's not mandatory to be in the group.