mezon-js 2.8.13 → 2.8.15

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.
package/api.gen.ts CHANGED
@@ -26,6 +26,8 @@ export interface ChannelUserListChannelUser {
26
26
  export interface ClanUserListClanUser {
27
27
  //from the `avatar_url` field in the `clan_desc_profile` table.
28
28
  clan_avatar?: string;
29
+ //
30
+ clan_id?: string;
29
31
  //from the `nick_name` field in the `clan_desc_profile` table.
30
32
  clan_nick?: string;
31
33
  //Their relationship to the role.
package/client.ts CHANGED
@@ -1080,6 +1080,7 @@ export class Client {
1080
1080
  mentions: m.mentions ? JSON.parse(m.mentions) : [],
1081
1081
  reactions: m.reactions ? JSON.parse(m.reactions) : [],
1082
1082
  references: m.references ? JSON.parse(m.references) : [],
1083
+ clan_id: m.clan_id
1083
1084
  })
1084
1085
  });
1085
1086
  return Promise.resolve(result);
@@ -1158,6 +1159,7 @@ export class Client {
1158
1159
  clan_avatar: gu.clan_avatar,
1159
1160
  clan_nick: gu.clan_nick,
1160
1161
  id: gu.id,
1162
+ clan_id: gu.clan_id
1161
1163
  })
1162
1164
  });
1163
1165
  return Promise.resolve(result);
package/dist/api.gen.d.ts CHANGED
@@ -11,6 +11,7 @@ export interface ChannelUserListChannelUser {
11
11
  /** A single user-role pair. */
12
12
  export interface ClanUserListClanUser {
13
13
  clan_avatar?: string;
14
+ clan_id?: string;
14
15
  clan_nick?: string;
15
16
  role_id?: string;
16
17
  user?: ApiUser;
@@ -4753,18 +4753,29 @@ var _DefaultSocket = class _DefaultSocket {
4753
4753
  } else if (message.channel_message) {
4754
4754
  var content, reactions, mentions, attachments, references;
4755
4755
  try {
4756
- if (content)
4757
- content = JSON.parse(message.channel_message.content);
4758
- if (reactions)
4759
- reactions = JSON.parse(message.channel_message.reactions);
4760
- if (mentions)
4761
- mentions = JSON.parse(message.channel_message.mentions);
4762
- if (attachments)
4763
- attachments = JSON.parse(message.channel_message.attachments);
4764
- if (references)
4765
- references = JSON.parse(message.channel_message.references);
4756
+ content = JSON.parse(message.channel_message.content);
4766
4757
  } catch (e2) {
4767
- console.log("error parse data", e2);
4758
+ console.log("content is invalid", e2);
4759
+ }
4760
+ try {
4761
+ reactions = JSON.parse(message.channel_message.reactions);
4762
+ } catch (e2) {
4763
+ console.log("reactions is invalid", e2);
4764
+ }
4765
+ try {
4766
+ mentions = JSON.parse(message.channel_message.mentions);
4767
+ } catch (e2) {
4768
+ console.log("mentions is invalid", e2);
4769
+ }
4770
+ try {
4771
+ attachments = JSON.parse(message.channel_message.attachments);
4772
+ } catch (e2) {
4773
+ console.log("attachments is invalid", e2);
4774
+ }
4775
+ try {
4776
+ references = JSON.parse(message.channel_message.references);
4777
+ } catch (e2) {
4778
+ console.log("references is invalid", e2);
4768
4779
  }
4769
4780
  var e = {
4770
4781
  avatar: message.channel_message.avatar,
@@ -5708,7 +5719,8 @@ var Client = class {
5708
5719
  attachments: m.attachments ? JSON.parse(m.attachments) : [],
5709
5720
  mentions: m.mentions ? JSON.parse(m.mentions) : [],
5710
5721
  reactions: m.reactions ? JSON.parse(m.reactions) : [],
5711
- references: m.references ? JSON.parse(m.references) : []
5722
+ references: m.references ? JSON.parse(m.references) : [],
5723
+ clan_id: m.clan_id
5712
5724
  });
5713
5725
  });
5714
5726
  return Promise.resolve(result);
@@ -5781,7 +5793,8 @@ var Client = class {
5781
5793
  thread_id: gu.thread_id,
5782
5794
  clan_avatar: gu.clan_avatar,
5783
5795
  clan_nick: gu.clan_nick,
5784
- id: gu.id
5796
+ id: gu.id,
5797
+ clan_id: gu.clan_id
5785
5798
  });
5786
5799
  });
5787
5800
  return Promise.resolve(result);
@@ -4724,18 +4724,29 @@ var _DefaultSocket = class _DefaultSocket {
4724
4724
  } else if (message.channel_message) {
4725
4725
  var content, reactions, mentions, attachments, references;
4726
4726
  try {
4727
- if (content)
4728
- content = JSON.parse(message.channel_message.content);
4729
- if (reactions)
4730
- reactions = JSON.parse(message.channel_message.reactions);
4731
- if (mentions)
4732
- mentions = JSON.parse(message.channel_message.mentions);
4733
- if (attachments)
4734
- attachments = JSON.parse(message.channel_message.attachments);
4735
- if (references)
4736
- references = JSON.parse(message.channel_message.references);
4727
+ content = JSON.parse(message.channel_message.content);
4737
4728
  } catch (e2) {
4738
- console.log("error parse data", e2);
4729
+ console.log("content is invalid", e2);
4730
+ }
4731
+ try {
4732
+ reactions = JSON.parse(message.channel_message.reactions);
4733
+ } catch (e2) {
4734
+ console.log("reactions is invalid", e2);
4735
+ }
4736
+ try {
4737
+ mentions = JSON.parse(message.channel_message.mentions);
4738
+ } catch (e2) {
4739
+ console.log("mentions is invalid", e2);
4740
+ }
4741
+ try {
4742
+ attachments = JSON.parse(message.channel_message.attachments);
4743
+ } catch (e2) {
4744
+ console.log("attachments is invalid", e2);
4745
+ }
4746
+ try {
4747
+ references = JSON.parse(message.channel_message.references);
4748
+ } catch (e2) {
4749
+ console.log("references is invalid", e2);
4739
4750
  }
4740
4751
  var e = {
4741
4752
  avatar: message.channel_message.avatar,
@@ -5679,7 +5690,8 @@ var Client = class {
5679
5690
  attachments: m.attachments ? JSON.parse(m.attachments) : [],
5680
5691
  mentions: m.mentions ? JSON.parse(m.mentions) : [],
5681
5692
  reactions: m.reactions ? JSON.parse(m.reactions) : [],
5682
- references: m.references ? JSON.parse(m.references) : []
5693
+ references: m.references ? JSON.parse(m.references) : [],
5694
+ clan_id: m.clan_id
5683
5695
  });
5684
5696
  });
5685
5697
  return Promise.resolve(result);
@@ -5752,7 +5764,8 @@ var Client = class {
5752
5764
  thread_id: gu.thread_id,
5753
5765
  clan_avatar: gu.clan_avatar,
5754
5766
  clan_nick: gu.clan_nick,
5755
- id: gu.id
5767
+ id: gu.id,
5768
+ clan_id: gu.clan_id
5756
5769
  });
5757
5770
  });
5758
5771
  return Promise.resolve(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.13",
3
+ "version": "2.8.15",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -872,19 +872,30 @@ export class DefaultSocket implements Socket {
872
872
  this.onstreamdata(<StreamData>message.stream_data);
873
873
  } else if (message.channel_message) {
874
874
  var content, reactions, mentions, attachments, references;
875
+ try {
876
+ content = JSON.parse(message.channel_message.content);
877
+ } catch(e) {
878
+ console.log("content is invalid", e)
879
+ }
880
+ try {
881
+ reactions = JSON.parse(message.channel_message.reactions);
882
+ } catch(e) {
883
+ console.log("reactions is invalid", e)
884
+ }
885
+ try {
886
+ mentions = JSON.parse(message.channel_message.mentions);
887
+ } catch(e) {
888
+ console.log("mentions is invalid", e)
889
+ }
890
+ try {
891
+ attachments = JSON.parse(message.channel_message.attachments);
892
+ } catch(e) {
893
+ console.log("attachments is invalid", e)
894
+ }
875
895
  try {
876
- if (content)
877
- content = JSON.parse(message.channel_message.content);
878
- if (reactions)
879
- reactions = JSON.parse(message.channel_message.reactions);
880
- if (mentions)
881
- mentions = JSON.parse(message.channel_message.mentions);
882
- if (attachments)
883
- attachments = JSON.parse(message.channel_message.attachments);
884
- if (references)
885
- references = JSON.parse(message.channel_message.references);
896
+ references = JSON.parse(message.channel_message.references);
886
897
  } catch(e) {
887
- console.log("error parse data", e);
898
+ console.log("references is invalid", e);
888
899
  }
889
900
  var e: ChannelMessageEvent = {
890
901
  avatar: message.channel_message.avatar,
package/dist/dist.zip DELETED
Binary file