feat(plugin): Export Contacts#2202
Conversation
|
what does this do that requesting your data package can't do? |
|
nothing i believe, but requesting a data package takes time and has a rate limit (iirc). if you have multiple accounts and want to quickly back up your contacts, or if you change/delete accounts often, this could come in handy |
| { | ||
| find: "fetchRelationships(){", | ||
| replacement: { | ||
| match: /\.then\(e=>o\.default\.dispatch\({type:"LOAD_RELATIONSHIPS_SUCCESS",relationships:e\.body}\)/, |
There was a problem hiding this comment.
don't hardcode variable names
| find: "fetchRelationships(){", | ||
| replacement: { | ||
| match: /\.then\(e=>o\.default\.dispatch\({type:"LOAD_RELATIONSHIPS_SUCCESS",relationships:e\.body}\)/, | ||
| replace: ".then(e=>{o.default.dispatch({type:\"LOAD_RELATIONSHIPS_SUCCESS\",relationships:e.body}); $self.getContacts(e.body)}" |
There was a problem hiding this comment.
use match groups instead of copy pasting the matched stuff
| find: "[role=\"tab\"][aria-disabled=\"false\"]", | ||
| replacement: { | ||
| match: /this\.props;return\(/, | ||
| replace: "this.props;console.log(a.Children);return(" |
| { | ||
| find: "[role=\"tab\"][aria-disabled=\"false\"]", | ||
| replacement: { | ||
| match: /(\w+)\.Children\.map\((\w+),\s*this\.renderChildren\)/, |
There was a problem hiding this comment.
use vencord's special \i to match identifiers
|
|
||
| addExportButton() { | ||
| return <ErrorBoundary noop key=".2"> | ||
| <button className="export-contacts-button" onClick={() => { this.copyContactToClipboard(); console.log("clicked"); }}>Export</button> |
There was a problem hiding this comment.
use Discord's button component to be compatible with themes
| } | ||
| // reason why you need to click the all tab is because the data is extracted during | ||
| // the request itself when you fetch all your friends. this is done to avoid sending a | ||
| // manual request to discord, which may raise suspicion and might even get you terminated. |
There was a problem hiding this comment.
it should be fine. just make sure you send the same request as discord normally would
|
I think txt export would be pretty nice too but does Discord have a split button widget? |
|
hi thanks a lot for your contribution! you havent addressed any of my feedback, are you still interested in working on this & getting it merged? i'll be closing this for now but if you're still interested, feel free to comment and we can reopen this |
A simple plugin that adds a export button to your friends tab on discord.

It exports it to your clipboard in a JSON format, and will export your added friends, incoming/outgoing friend requests, and blocked users.