DiscordChatExporter icon indicating copy to clipboard operation
DiscordChatExporter copied to clipboard

Store mention ID in JSON

Open pie3636 opened this issue 3 years ago • 1 comments

Hello! First of all, thanks for this great piece of software.

I am doing some parsing of messages on a server where I need to be able to link mentions to their original user in a permanent way. The way DiscordChatExporter currently works, mentions only get exported as "@nickname", which is prone to change very quickly. Would it be possible to get the full user ID, at least in the JSON format? Since I assume most people using JSON are looking for a way to process the data later, I feel it would also make sense (if the Discord API exposes this data).

For the implementation, I would suggest having an additional field mentions where all mentions present in the message/embed are dumped in sequential order. Something like this for example:

{
  ...
  "content": "Hello @User1! Welcome to this server owned by @User2",
  "mentions": [
    {
      "id": 01234567890123456,
      "name": "User1",
      "discriminator": "1234",
      "nickname": "New User"
    },
    {
      "id": 01234567890123457,
      "name": "User2",
      "discriminator": "5678",
      "nickname": "The Owner"
    },
  ],
  ...
}

pie3636 avatar Oct 20 '20 18:10 pie3636

Another option would be to store mentions in the original <@01234567890123456> format. A similar change would also be helpful for identifying custom emoji.

fenhl avatar Mar 25 '21 19:03 fenhl

This is something i think is needed, since it's just showin unknown everytime in exports, so having the id insted would be a life saver!

benzon avatar Jan 24 '23 03:01 benzon

This is something i think is needed, since it's just showin unknown everytime in exports, so having the id insted would be a life saver!

That's related to #939

Tyrrrz avatar Jan 24 '23 17:01 Tyrrrz

Closing in favor of #741. With that implemented, you'd be able to export without markdown parsing and get mention IDs inside the content field.

Tyrrrz avatar Feb 15 '23 20:02 Tyrrrz