mezon-js 2.8.12 → 2.8.13

Sign up to get free protection for your applications and to get access to all the features.
package/dist/dist.zip ADDED
Binary file
@@ -4753,12 +4753,18 @@ var _DefaultSocket = class _DefaultSocket {
4753
4753
  } else if (message.channel_message) {
4754
4754
  var content, reactions, mentions, attachments, references;
4755
4755
  try {
4756
- content = JSON.parse(message.channel_message.content);
4757
- reactions = JSON.parse(message.channel_message.reactions);
4758
- mentions = JSON.parse(message.channel_message.mentions);
4759
- attachments = JSON.parse(message.channel_message.attachments);
4760
- references = JSON.parse(message.channel_message.references);
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);
4761
4766
  } catch (e2) {
4767
+ console.log("error parse data", e2);
4762
4768
  }
4763
4769
  var e = {
4764
4770
  avatar: message.channel_message.avatar,
@@ -4724,12 +4724,18 @@ var _DefaultSocket = class _DefaultSocket {
4724
4724
  } else if (message.channel_message) {
4725
4725
  var content, reactions, mentions, attachments, references;
4726
4726
  try {
4727
- content = JSON.parse(message.channel_message.content);
4728
- reactions = JSON.parse(message.channel_message.reactions);
4729
- mentions = JSON.parse(message.channel_message.mentions);
4730
- attachments = JSON.parse(message.channel_message.attachments);
4731
- references = JSON.parse(message.channel_message.references);
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);
4732
4737
  } catch (e2) {
4738
+ console.log("error parse data", e2);
4733
4739
  }
4734
4740
  var e = {
4735
4741
  avatar: message.channel_message.avatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.8.12",
3
+ "version": "2.8.13",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -872,14 +872,19 @@ 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
- reactions = JSON.parse(message.channel_message.reactions);
878
- mentions = JSON.parse(message.channel_message.mentions);
879
- attachments = JSON.parse(message.channel_message.attachments);
880
- references = JSON.parse(message.channel_message.references);
875
+ 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);
881
886
  } catch(e) {
882
- //console.log("error parse data", e);
887
+ console.log("error parse data", e);
883
888
  }
884
889
  var e: ChannelMessageEvent = {
885
890
  avatar: message.channel_message.avatar,