This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0cc311
commit 89fc11a
Showing
14 changed files
with
189 additions
and
883 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ package-lock.json | |
test2.js | ||
config.json | ||
npm-debug.log | ||
extension.pem | ||
extension.pem | ||
dist/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
directories: | ||
output: dist | ||
buildResources: build | ||
mac: | ||
category: public.app-category.social-networking | ||
target: | ||
- dmg | ||
- zip | ||
icon: buildResources/icon.png | ||
linux: | ||
target: | ||
- AppImage | ||
- deb | ||
- rpm | ||
- freebsd | ||
- pacman | ||
- p5p | ||
- apk | ||
icon: buildResources/icon.png | ||
win: | ||
target: | ||
- target: nsis | ||
arch: | ||
- x64 | ||
- ia32 | ||
icon: buildResources/icon.png | ||
electronVersion: 9.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
const { app, BrowserWindow, systemPreferences } = require("electron"); | ||
const fetch = require("node-fetch"); | ||
const btoa = require("btoa"); | ||
|
||
async function createWindow() { | ||
var html = await fetch("https://raw.githubusercontent.com/Flam3rboy/discord-bot-client/master/index.html"); | ||
html = await html.text(); | ||
// Create the browser window. | ||
let win = new BrowserWindow({ | ||
width: 1920, | ||
height: 1080, | ||
icon: __dirname + "/buildResources/icon.png", | ||
webPreferences: { | ||
webSecurity: true, | ||
nodeIntegration: false, | ||
enableRemoteModule: false, | ||
contextIsolation: true, | ||
}, | ||
}); | ||
// win.webContents.openDevTools(); | ||
win.webContents.on("did-navigate", () => { | ||
win.webContents.executeJavaScript(`document.write(atob("${btoa(html)}"))`); | ||
}); | ||
systemPreferences.askForMediaAccess("microphone"); | ||
win.webContents.on("new-window", function (e, url) { | ||
e.preventDefault(); | ||
require("electron").shell.openExternal(url); | ||
}); | ||
win.loadURL("https://blank.org"); | ||
// win.loadURL("data:text/html;charset=UTF-8," + encodeURIComponent(html), { | ||
// baseURLForDataURL: `file://${__dirname}/app`, | ||
// }); | ||
|
||
const filter = { | ||
urls: ["<all_urls>"], | ||
}; | ||
const { session } = win.webContents; | ||
|
||
session.webRequest.onBeforeSendHeaders(filter, (details, callback) => { | ||
details.requestHeaders["origin"] = "https://discord.com"; | ||
if ( | ||
[ | ||
"https://discord.com/api/v6/users/@me/library", | ||
"https://discord.com/api/v6/users/@me/guilds/premium/subscriptions", | ||
"https://discord.com/api/v6/science", | ||
].includes(details.url) || | ||
details.url.includes("https://discord.com/api/v6/users/@me/billing/trials/") || | ||
details.url.includes("https://discord.com/api/v6/users/@me/applications/") | ||
) { | ||
return callback({ cancel: true }); | ||
} | ||
delete details.requestHeaders["User-Agent"]; | ||
|
||
callback({ requestHeaders: details.requestHeaders }); | ||
}); | ||
|
||
session.webRequest.onHeadersReceived(filter, (details, callback) => { | ||
details.responseHeaders["access-control-allow-origin"] = "*"; | ||
|
||
callback({ responseHeaders: details.responseHeaders }); | ||
}); | ||
} | ||
|
||
app.whenReady().then(createWindow); | ||
|
||
app.on("window-all-closed", () => { | ||
if (process.platform !== "darwin") { | ||
app.quit(); | ||
} | ||
}); | ||
|
||
app.on("activate", () => { | ||
if (BrowserWindow.getAllWindows().length === 0) { | ||
createWindow(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"name": "discord-bot-client", | ||
"version": "3.1.0", | ||
"description": "Discord Bot Client - login into discord with a bot token", | ||
"main": "index.js", | ||
"scripts": { | ||
"pack": "electron-builder --dir -mwl", | ||
"dist": "electron-builder -mwl" | ||
}, | ||
"keywords": [], | ||
"author": { | ||
"name": "Flam3rboy", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"url": "https://github.com/Flam3rboy/discord-bot-client/" | ||
}, | ||
"license": "ISC", | ||
"productName": "Discord Bot Client", | ||
"appId": "com.electron.discord-bot-client", | ||
"devDependencies": { | ||
"electron": "^9.1.2", | ||
"electron-builder": "^22.8.0" | ||
}, | ||
"build": { | ||
"mac": { | ||
"category": "public.app-category.social-networking", | ||
"target": [ | ||
"dmg", | ||
"zip" | ||
], | ||
"icon": "buildResources/icon.png" | ||
}, | ||
"linux": { | ||
"target": [ | ||
"AppImage", | ||
"deb", | ||
"rpm", | ||
"freebsd", | ||
"pacman", | ||
"p5p", | ||
"apk" | ||
], | ||
"icon": "buildResources/icon.png" | ||
}, | ||
"win": { | ||
"target": [ | ||
{ | ||
"target": "nsis", | ||
"arch": [ | ||
"x64", | ||
"ia32" | ||
] | ||
} | ||
], | ||
"icon": "buildResources/icon.png" | ||
} | ||
}, | ||
"dependencies": { | ||
"btoa": "^1.2.1", | ||
"node-fetch": "^2.6.0" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Discord Bot Client</title> | ||
</head> | ||
<body> | ||
<ul> | ||
<li></li> | ||
</ul> | ||
<script src="popup.js"></script> | ||
</body> | ||
</html> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.