-
-
Notifications
You must be signed in to change notification settings - Fork 724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix import of json file #421
Conversation
This feature is usually used when running the script for a longer period of time or overnight, and it would ask for confirmation about deleting every chat once it goes to the next one. I would add a checkbox that would say auto-confirm, so you can run it overnight. Would that fit into this PR as well or should I create a new one for that? EDIT: Same question with using GM_setValue and GM_getValue to store progress of the import file when reloading browser // shutting down pc |
This is what I was waiting and looking for! Happy Google led me to this. Will test now. I had to compile this myself to test it, and in doing so, ran into some ESLint errors, which I've fixed in a small PR to your PR. |
I will have a look regarding the eslint errors, also if you are interested give me feedback regarding my comment above |
I would... I wanted to use this to delete older messages, but it seems a lot of servers I'm not on, so things 403. Regarding servers I'm not in anymore, I saw someone comment in discussions that they contacted discord with a GDPR request to delete messages from specific channel IDs. Will likely have to resort to that. |
Alright, I will add a commit with the fixed eslint errors and support for auto confirm / keeping track of your already deleted messages in a few days |
@TcNobo Hey, I added the autoconfirm button + it now stores the progress and you are able to load it with a load last import button. Please let me know if you think of anything that should be added |
@Flo4604 Thank you for submitting this PR. I haven't tested it but it looks fine. I will try to merge this to main, but before I would like to refactor a few things. The funcional approach I had at the beginning was simple but it is not scaling with all the features being added. I want to keep logic like this outside of the index.js where is mainly UI stuff. |
@victornpb all right, should I make a commit to remove the GM Methods? I might investigate better discord as well and find a way to store progress that works in the browser as well |
I refactored the entire codebase since last week, so it will be really hard to merge this PR. I could incorporate your changes myself. But if you would like to have your name as a contributor, I need you to open a new PR from the next branch back to Let me know what you prefer, it should be more straightforward now, I implemented a runBatch that you can pass an Array (currently it is just an array of strings channelIds, but It can be changed to an array of objects containing channel sever etc). About the GM method I think we should not have the restore button, and have the person to input the file every time, less convenient but it makes things simpler. |
I'll re-implement it at the new branch, should we just close this MR then?
I understand the thought behind that, it is just more convenient since we don't have to scan DM channels which we already went through. We could add this when undiscord is better discord compatible as well, I am sure there will be a way to store the needed data on both better discord and the browser using the same method. I'll leave it out of the new pr |
Tbh I don't fully understand whats is inside the discord archive, I can assume looking at the code that it only works with DMs right? So the reason I thought the store was unnecessary is because I assumed we could wipe everything in one go, so no need to store anything. If so I don't think leaving it out would be much slower, because it wouldn't take too long to search a bunch of empty channels (dms) very quickly, and eventually catch where it was before. Lets leave this open for now until we have a new PR. I will think about a good way to have persistence in another moment, but for now I just want to have this tested and merged. |
Yeah, that was my point
No, it works on all channels, the file you import from the discord package ( messages/index.json ) contains all channel's you sent messages in, either DM's or Server Channels / Threads. |
interesting, do you have the guildId as well? because I think I rather do that if I could, because I kept the requests as close as possible as the discord client, in an attempt to make it less detectable. I have requested my data so I can test it, but I'm still waiting, they say it an take a couple days... I kinda prepared the code to receive that feature, it think it is a nice improvement over the old codebase it was getting kinda hard to follow https://github.com/victornpb/undiscord/blob/next/src/undiscord-ui.js#L284-L310 |
This PR is for being able to use the import JSON button again, as its a feature that many ppl including myself would like to have back