@mtkruto/node 0.1.160 → 0.1.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -119,9 +119,10 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
119
119
  isTopicMessage: false,
120
120
  };
121
121
  Object.assign(message, await getSender(message_, getEntity));
122
- if (message_.action instanceof types.MessageActionChatAddUser) {
122
+ if (message_.action instanceof types.MessageActionChatAddUser || message_.action instanceof types.MessageActionChatJoinedByLink || message_.action instanceof types.MessageActionChatJoinedByRequest) {
123
123
  const newChatMembers = new Array();
124
- for (const user_ of message_.action.users) {
124
+ const users = "users" in message_.action ? message_.action.users : [message_.from_id && "user_id" in message_.from_id ? message_.from_id.user_id : UNREACHABLE()];
125
+ for (const user_ of users) {
125
126
  const entity = await getEntity(new types.PeerUser({ user_id: user_ }));
126
127
  if (entity) {
127
128
  const user = constructUser(entity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mtkruto/node",
3
- "version": "0.1.160",
3
+ "version": "0.1.161",
4
4
  "description": "MTKruto for Node.js",
5
5
  "author": "Roj <rojvv@icloud.com>",
6
6
  "repository": {
@@ -123,9 +123,10 @@ async function constructServiceMessage(message_, chat, getEntity, getMessage) {
123
123
  isTopicMessage: false,
124
124
  };
125
125
  Object.assign(message, await getSender(message_, getEntity));
126
- if (message_.action instanceof _2_tl_js_1.types.MessageActionChatAddUser) {
126
+ if (message_.action instanceof _2_tl_js_1.types.MessageActionChatAddUser || message_.action instanceof _2_tl_js_1.types.MessageActionChatJoinedByLink || message_.action instanceof _2_tl_js_1.types.MessageActionChatJoinedByRequest) {
127
127
  const newChatMembers = new Array();
128
- for (const user_ of message_.action.users) {
128
+ const users = "users" in message_.action ? message_.action.users : [message_.from_id && "user_id" in message_.from_id ? message_.from_id.user_id : (0, _1_utilities_js_1.UNREACHABLE)()];
129
+ for (const user_ of users) {
129
130
  const entity = await getEntity(new _2_tl_js_1.types.PeerUser({ user_id: user_ }));
130
131
  if (entity) {
131
132
  const user = (0, _1_user_js_1.constructUser)(entity);