TextsHQ / platform-discord

MIT License
1 stars 0 forks source link

Delete _original from an Edited Message #9

Closed nt92 closed 4 months ago

nt92 commented 2 years ago

Was getting this error on Discord when editing a message:

{
  platformName: 'discord',
  accountID: 'discord_3a8c9cd84528788f1db56f95858dfecc',
  methodName: 'subscribeToEvents'
} invalid StateSyncEvent[0].entries for mutationType = 'update': should not have '_original' field {
  _original: '{"id":"1021903376507740351","type":0,"content":"test5?","channel_id":"911273978767757312","author":{"avatar":"17271c600662f3b4cf1c60df5ba6c0ed","avatar_decoration":null,"discriminator":"1192","id":"693620266647158805","public_flags":0,"username":"thot"},"attachments":[],"embeds":[],"mentions":[],"mention_roles":[],"pinned":false,"mention_everyone":false,"tts":false,"timestamp":"2022-09-20T21:59:11.006000+00:00","edited_timestamp":"2022-09-20T22:24:51.823466+00:00","flags":0,"components":[]}',
  id: '1021903376507740351',
  linkedMessageID: undefined,
  threadID: '911273978767757312',
  text: 'test5?',
  senderID: '693620266647158805',
  isSender: true,
  timestamp: 2022-09-20T21:59:11.006Z,
  editedTimestamp: 2022-09-20T22:24:51.823Z,
  tweets: [],
  links: [],
  attachments: []
}

Deleted _original from the message when we're editing so that it doesn't change the OG message.