mezon-js 2.8.12 → 2.8.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -4754,11 +4754,28 @@ var _DefaultSocket = class _DefaultSocket {
4754
4754
  var content, reactions, mentions, attachments, references;
4755
4755
  try {
4756
4756
  content = JSON.parse(message.channel_message.content);
4757
+ } catch (e2) {
4758
+ console.log("content is invalid", e2);
4759
+ }
4760
+ try {
4757
4761
  reactions = JSON.parse(message.channel_message.reactions);
4762
+ } catch (e2) {
4763
+ console.log("reactions is invalid", e2);
4764
+ }
4765
+ try {
4758
4766
  mentions = JSON.parse(message.channel_message.mentions);
4767
+ } catch (e2) {
4768
+ console.log("mentions is invalid", e2);
4769
+ }
4770
+ try {
4759
4771
  attachments = JSON.parse(message.channel_message.attachments);
4772
+ } catch (e2) {
4773
+ console.log("attachments is invalid", e2);
4774
+ }
4775
+ try {
4760
4776
  references = JSON.parse(message.channel_message.references);
4761
4777
  } catch (e2) {
4778
+ console.log("references is invalid", e2);
4762
4779
  }
4763
4780
  var e = {
4764
4781
  avatar: message.channel_message.avatar,
@@ -4725,11 +4725,28 @@ var _DefaultSocket = class _DefaultSocket {
4725
4725
  var content, reactions, mentions, attachments, references;
4726
4726
  try {
4727
4727
  content = JSON.parse(message.channel_message.content);
4728
+ } catch (e2) {
4729
+ console.log("content is invalid", e2);
4730
+ }
4731
+ try {
4728
4732
  reactions = JSON.parse(message.channel_message.reactions);
4733
+ } catch (e2) {
4734
+ console.log("reactions is invalid", e2);
4735
+ }
4736
+ try {
4729
4737
  mentions = JSON.parse(message.channel_message.mentions);
4738
+ } catch (e2) {
4739
+ console.log("mentions is invalid", e2);
4740
+ }
4741
+ try {
4730
4742
  attachments = JSON.parse(message.channel_message.attachments);
4743
+ } catch (e2) {
4744
+ console.log("attachments is invalid", e2);
4745
+ }
4746
+ try {
4731
4747
  references = JSON.parse(message.channel_message.references);
4732
4748
  } catch (e2) {
4749
+ console.log("references is invalid", e2);
4733
4750
  }
4734
4751
  var e = {
4735
4752
  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.14",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },
package/socket.ts CHANGED
@@ -872,14 +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 {
875
+ try {
876
876
  content = JSON.parse(message.channel_message.content);
877
+ } catch(e) {
878
+ console.log("content is invalid", e)
879
+ }
880
+ try {
877
881
  reactions = JSON.parse(message.channel_message.reactions);
882
+ } catch(e) {
883
+ console.log("reactions is invalid", e)
884
+ }
885
+ try {
878
886
  mentions = JSON.parse(message.channel_message.mentions);
887
+ } catch(e) {
888
+ console.log("mentions is invalid", e)
889
+ }
890
+ try {
879
891
  attachments = JSON.parse(message.channel_message.attachments);
892
+ } catch(e) {
893
+ console.log("attachments is invalid", e)
894
+ }
895
+ try {
880
896
  references = JSON.parse(message.channel_message.references);
881
897
  } catch(e) {
882
- //console.log("error parse data", e);
898
+ console.log("references is invalid", e);
883
899
  }
884
900
  var e: ChannelMessageEvent = {
885
901
  avatar: message.channel_message.avatar,