-
-
Notifications
You must be signed in to change notification settings - Fork 410
[Question] Source code refactoring. #198
Comments
Addition: I know at an intermediate level HTML, CSS, JS. |
You need to install NodeJS and NPM
you need to make a few changes: const fs = require("fs/promises"); and at line 10 insert this: html = fs.readFile(__dirname + "/../index.html"); this will load your local index.html file instead of the github hosted one.
the index.html file will download the discord js source, searches for the relevant file and patches it. |
update version: const fixAffinities = fixLibraryApplications.replace(
",r.default.get({url:i.Endpoints.USER_AFFINITIES,retries:e?3:0}).then((function(e){var t=e.body;a.default.dispatch({type:i.ActionTypes.LOAD_USER_AFFINITIES_SUCCESS,affinities:t})}),(function(){a.default.dispatch({type:i.ActionTypes.LOAD_USER_AFFINITIES_FAILURE})}))):Promise.resolve()",
`,setTimeout(()=>{
var exampleAffinities = {"user_affinities": [], "inverse_user_affinities": []}
a.default.dispatch({
type: i.ActionTypes.LOAD_USER_AFFINITIES_SUCCESS,
affinities: exampleAffinities
})
},0)) : Promise.resolve()`
); new: const fixAffinities = fixLibraryApplications.replace(
",l.default.get({url:i.Endpoints.USER_AFFINITIES,retries:e?3:0}).then((function(h){var t=h.body;j.default.dispatch({type:i.ActionTypes.LOAD_USER_AFFINITIES_SUCCESS,affinities:t})}),(function(){a.default.dispatch({type:i.ActionTypes.LOAD_USER_AFFINITIES_FAILURE})}))):Promise.resolve()",
`,setTimeout(()=>{
var exampleAffinities = {"user_affinities": [], "inverse_user_affinities": []}
j.default.dispatch({
type: i.ActionTypes.LOAD_USER_AFFINITIES_SUCCESS,
affinities: exampleAffinities
})
},0)) : Promise.resolve()`
); ^ notice the changed variable names (r -> l, a -> j, e -> h) if you want to make it compatible with all futures version you could instead convert the search and replace strings to regular expressions |
@BuilderHD Have you made a newer version of the bot client / is it available for download? |
How would I get the latest source? |
download the html from https://discord.com/app |
This works too right? https://canary.discord.com/app |
Hmm it doesn't work with latest sources |
i tried updating it replacing .js files and CSS with new one but it didn't work too (i actually ended up to give up) |
nvm i will try again |
Hello developer!
Can the source code for this client be modified for me?
Here's what I mean: I'll download the source code for the client, and I'll try to fix the bugs. If I can fix at least one bug, can I create a repository on github? (I'll list the author and original repository)
The text was updated successfully, but these errors were encountered: