No updates received when user joins newly created supergroup via invite link
Hi,
I'm experiencing an issue when working with supergroups and invite links using TDLib (accessed via the tdl JavaScript library).
Steps to reproduce:
- Create a new supergroup using
createNewSupergroupChat. - Create an invite link for the supergroup using
createChatInviteLink. - Join the supergroup from another Telegram account using the invite link (either the newly created one or the default one).
Expected behavior:
When the other account joins the supergroup, I expect to receive an update such as updateNewMessage, updateChatLastMessage, or something similar, so I can react to the new member joining.
Actual behavior:
No update is emitted when the other account joins the supergroup.
However, if I follow the same process with createNewBasicGroupChat instead of createNewSupergroupChat, I do receive the expected update when the other account joins.
I was also advised to call openChat on the supergroup after creation. This did result in some updates, but still no update is received when a user joins the supergroup.
Environment:
- tdl: 8.0.2
Code snippet (using tdl):
client.on('update', (update) => {
console.log(`Update: ${update._}`);
});
const supergroup = await client.invoke({
_: 'createNewSupergroupChat',
title: 'Test Supergroup',
is_channel: false,
description: '',
});
await client.invoke({
_: 'openChat',
chat_id: supergroup.id,
});
const inviteLink = await client.invoke({
_: 'createChatInviteLink',
chat_id: supergroup.id,
});
// Join from another account using inviteLink.invite_link
// No update is received on the original client when the user joins
Questions:
- Is this the expected behavior for supergroups in TDLib?
- Is there a recommended way to detect when a new member joins a supergroup created this way?
- Are there any additional steps required to receive such updates for supergroups?
Thanks for your help!
Is this the expected behavior for supergroups in TDLib?
Service messages are sent by the server whenever appropriate. Any behavior regarding their presence is expected behavior.
Is there a recommended way to detect when a new member joins a supergroup created this way?
Bot accounts must be used for all automatic tasks like detection of new users in a chat. Regular users never need to "detect" new chat members.
Are there any additional steps required to receive such updates for supergroups?
https://core.telegram.org/bots/api