├── version.js ├── .gitattributes ├── app └── preload.js ├── config └── config.json ├── .eslintignore ├── .gitignore ├── assets ├── images │ ├── TextLogo.png │ ├── logo │ │ ├── 16x16.png │ │ ├── 32x32.png │ │ ├── icon.ico │ │ ├── apple-touch-icon.png │ │ ├── android-chrome-192x192.png │ │ └── android-chrome-512x512.png │ ├── betterdiscordpanel.png │ ├── contribution │ │ ├── fork.png │ │ ├── upload.png │ │ ├── translate.png │ │ ├── create_pull.png │ │ └── openlocales.png │ ├── previews │ │ ├── preview.png │ │ └── dropShadow.png │ └── discord_defaults_avatars │ │ ├── 0.png │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ └── 4.png ├── fonts │ ├── remixicon8025.eot │ ├── remixicon8025.html │ ├── remixicon8025.ttf │ ├── remixicon8025.woff │ ├── materialdesignicons-webfont7e1c.eot │ ├── materialdesignicons-webfont7e1c.ttf │ ├── materialdesignicons-webfontd41d.eot │ ├── materialdesignicons-webfont7e1c.html │ └── materialdesignicons-webfont7e1c.woff ├── js │ ├── main │ │ ├── translation.js │ │ ├── format.js │ │ ├── addText.js │ │ ├── escapeHTML.js │ │ ├── formatTimestamp.js │ │ ├── tempChange.js │ │ ├── embedLinks.js │ │ ├── isLoggedIn.js │ │ ├── replaceMarkdown.js │ │ ├── deleteMessage.js │ │ ├── translator.js │ │ ├── login.js │ │ ├── contentReplacement.js │ │ └── settings.js │ ├── panel │ │ ├── copyright.js │ │ ├── documentEvents.js │ │ ├── languages.js │ │ ├── keypasteEvents.js │ │ ├── constants.js │ │ ├── buttonEvents.js │ │ ├── discordEvents.js │ │ └── functions.js │ ├── checks.js │ ├── pages │ │ └── index.init.js │ ├── login │ │ └── loginscreen.js │ ├── log.js │ ├── app.js │ ├── update.js │ ├── content.js │ └── locales.js └── libs │ ├── owl.carousel │ └── assets │ │ ├── owl.video.play.png │ │ ├── owl.theme.default.min.css │ │ └── owl.carousel.min.css │ ├── noty │ ├── nest.css │ └── noty.css │ ├── normalize │ └── normalize.min.css │ ├── node-waves │ └── waves.min.js │ ├── magnific-popup │ └── magnific-popup.css │ └── jquery │ └── jquery.transit.js ├── docs └── prerequisites │ ├── images │ ├── step-1.png │ ├── step-2.png │ └── step-3.png │ └── prerequisites.md ├── .github ├── dependabot.yml ├── CONTRIBUTION.md ├── ISSUE_TEMPLATE │ ├── suggestions.md │ └── bug_report.md └── TRANSLATION.md ├── .editorconfig ├── BetterDiscordPanel.cmd ├── SECURITY.md ├── .eslintrc.json ├── scripts ├── boot │ ├── boot.js │ ├── Start.ps1 │ └── Checks.ps1 ├── Selection.ps1 └── settings │ ├── Languages │ ├── Languages3.ps1 │ ├── Languages1.ps1 │ └── Languages2.ps1 │ ├── Settings.ps1 │ ├── Support.ps1 │ ├── Update.ps1 │ └── Language.ps1 ├── locales ├── template │ └── template.json ├── id │ └── panel.json ├── en │ └── panel.json ├── no │ └── panel.json ├── de │ └── panel.json ├── hu │ └── panel.json ├── tr │ └── panel.json ├── nl │ └── panel.json ├── fr │ └── panel.json ├── ru │ └── panel.json ├── es │ └── panel.json └── ro │ └── panel.json ├── package.json ├── index.js ├── login.html ├── CODE_OF_CONDUCT.md └── README.md /version.js: -------------------------------------------------------------------------------- 1 | version = '3.0.2'; 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /app/preload.js: -------------------------------------------------------------------------------- 1 | // Add code here that requires Node 2 | -------------------------------------------------------------------------------- /config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "language": "en" 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | assets/libs* 2 | assets/js/discord.12.1.1.min.js* -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Remove Debug logs 2 | scripts/boot/debug.log 3 | # Node Modules 4 | node_modules 5 | -------------------------------------------------------------------------------- /assets/images/TextLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/TextLogo.png -------------------------------------------------------------------------------- /assets/images/logo/16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/16x16.png -------------------------------------------------------------------------------- /assets/images/logo/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/32x32.png -------------------------------------------------------------------------------- /assets/images/logo/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/icon.ico -------------------------------------------------------------------------------- /assets/fonts/remixicon8025.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/remixicon8025.eot -------------------------------------------------------------------------------- /assets/fonts/remixicon8025.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/remixicon8025.html -------------------------------------------------------------------------------- /assets/fonts/remixicon8025.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/remixicon8025.ttf -------------------------------------------------------------------------------- /assets/fonts/remixicon8025.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/remixicon8025.woff -------------------------------------------------------------------------------- /assets/images/betterdiscordpanel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/betterdiscordpanel.png -------------------------------------------------------------------------------- /assets/images/contribution/fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/contribution/fork.png -------------------------------------------------------------------------------- /assets/images/previews/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/previews/preview.png -------------------------------------------------------------------------------- /docs/prerequisites/images/step-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/docs/prerequisites/images/step-1.png -------------------------------------------------------------------------------- /docs/prerequisites/images/step-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/docs/prerequisites/images/step-2.png -------------------------------------------------------------------------------- /docs/prerequisites/images/step-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/docs/prerequisites/images/step-3.png -------------------------------------------------------------------------------- /assets/images/contribution/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/contribution/upload.png -------------------------------------------------------------------------------- /assets/images/previews/dropShadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/previews/dropShadow.png -------------------------------------------------------------------------------- /assets/images/contribution/translate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/contribution/translate.png -------------------------------------------------------------------------------- /assets/images/logo/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/apple-touch-icon.png -------------------------------------------------------------------------------- /assets/images/contribution/create_pull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/contribution/create_pull.png -------------------------------------------------------------------------------- /assets/images/contribution/openlocales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/contribution/openlocales.png -------------------------------------------------------------------------------- /assets/images/discord_defaults_avatars/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/discord_defaults_avatars/0.png -------------------------------------------------------------------------------- /assets/images/discord_defaults_avatars/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/discord_defaults_avatars/1.png -------------------------------------------------------------------------------- /assets/images/discord_defaults_avatars/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/discord_defaults_avatars/2.png -------------------------------------------------------------------------------- /assets/images/discord_defaults_avatars/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/discord_defaults_avatars/3.png -------------------------------------------------------------------------------- /assets/images/discord_defaults_avatars/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/discord_defaults_avatars/4.png -------------------------------------------------------------------------------- /assets/images/logo/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/android-chrome-192x192.png -------------------------------------------------------------------------------- /assets/images/logo/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/images/logo/android-chrome-512x512.png -------------------------------------------------------------------------------- /assets/fonts/materialdesignicons-webfont7e1c.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/materialdesignicons-webfont7e1c.eot -------------------------------------------------------------------------------- /assets/fonts/materialdesignicons-webfont7e1c.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/materialdesignicons-webfont7e1c.ttf -------------------------------------------------------------------------------- /assets/fonts/materialdesignicons-webfontd41d.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/materialdesignicons-webfontd41d.eot -------------------------------------------------------------------------------- /assets/js/main/translation.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file translation.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | // BetterDiscordPanel 8 | 9 | -------------------------------------------------------------------------------- /assets/fonts/materialdesignicons-webfont7e1c.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/materialdesignicons-webfont7e1c.html -------------------------------------------------------------------------------- /assets/fonts/materialdesignicons-webfont7e1c.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/fonts/materialdesignicons-webfont7e1c.woff -------------------------------------------------------------------------------- /assets/libs/owl.carousel/assets/owl.video.play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SanjaySunil/BetterDiscordPanel/HEAD/assets/libs/owl.carousel/assets/owl.video.play.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | target-branch: master 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 2 10 | -------------------------------------------------------------------------------- /assets/js/main/format.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file format.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function format(command, value) { 8 | document.execCommand(command, false, value); 9 | } 10 | -------------------------------------------------------------------------------- /BetterDiscordPanel.cmd: -------------------------------------------------------------------------------- 1 | @ECHO off 2 | IF NOT DEFINED IS_CHILD_PROCESS (CMD /K SET IS_CHILD_PROCESS=1 ^& %0 %*) & EXIT 3 | TITLE BetterDiscordPanel 4 | CLS 5 | ECHO. 6 | 7 | cd scripts 8 | powershell -ExecutionPolicy Bypass .\Selection.ps1 9 | -------------------------------------------------------------------------------- /assets/js/main/addText.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file addText.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function addText(value) { 8 | const toSend = $('#toSend'); 9 | toSend.html(`${toSend.html() + escapeHtml(value)} `); 10 | } 11 | -------------------------------------------------------------------------------- /assets/js/panel/copyright.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file copyright.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | $('.000').replaceWith('Copyright © 2022'); 8 | $('.001').replaceWith('Sanjay Sunil'); 9 | $('.002').replaceWith('All rights reserved.'); 10 | -------------------------------------------------------------------------------- /assets/js/panel/documentEvents.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file documentEvents.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | $(document).on('change', '.guilds', () => { 8 | updateGuild(); 9 | }); 10 | 11 | $(document).on('change', '.channels', () => { 12 | updateChannel(); 13 | }); 14 | -------------------------------------------------------------------------------- /assets/js/main/escapeHTML.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file escapeHTML.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function escapeHtml(text) { 8 | return text 9 | .replace(/&/g, '&') 10 | .replace(//g, '>') 12 | .replace(/"/g, '"') 13 | .replace(/'/g, '''); 14 | } 15 | -------------------------------------------------------------------------------- /assets/js/main/formatTimestamp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file formatTimestamp.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function formatTimestamp(timestamp) { 8 | const date = new Date(timestamp); 9 | return `${date.toLocaleDateString( 10 | translation.langCode, 11 | )} ${date.toLocaleTimeString(translation.langCode)}`; 12 | } 13 | -------------------------------------------------------------------------------- /assets/js/main/tempChange.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file tempChange.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function tempChange(DOM, text, time) { 8 | const newText = `${$(DOM).text().replace(text, '')} ${text}`; 9 | 10 | $(DOM).html(newText); 11 | 12 | setTimeout(() => { 13 | $(DOM).html(newText.replace(text, '')); 14 | }, time); 15 | } 16 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 2.7.x | :white_check_mark: | 8 | | < 2.0 | :x: | 9 | 10 | ## Reporting a Vulnerability 11 | 12 | Please email sanjaysunil@protonmail.com to report a vulnerability. 13 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "commonjs": true, 5 | "es2021": true, 6 | "node": true 7 | }, 8 | "extends": [ 9 | "google" 10 | ], 11 | "parserOptions": { 12 | "ecmaVersion": 12 13 | }, 14 | "rules": { 15 | "require-jsdoc": 0, 16 | "max-len": 0, 17 | "no-invalid-this": 0, 18 | "no-unused-vars": 0, 19 | "prefer-const": 0 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/CONTRIBUTION.md: -------------------------------------------------------------------------------- 1 | # How to contribute to BetterDiscordPanel 2 | 3 | ## 1. Fork the Repository 4 | 5 | ![fork](../assets/images/contribution/fork.png) 6 | 7 | ## 2. Make your changes 8 | 9 | ![changes](../assets/images/contribution/upload.png) 10 | 11 | ## 3. Make a pull request 12 | 13 | ![pr](../assets/images/contribution/create_pull.png) 14 | 15 | *** 16 | 17 | #### If you encounter any problems, please create a new issue. 18 | -------------------------------------------------------------------------------- /scripts/boot/boot.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file boot.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | const {exec} = require('child_process'); 8 | 9 | exec('cd ../../ && npm start', (error, stdout, stderr) => { 10 | if (error) { 11 | console.log(`[ERROR]: ${error.message}`); 12 | return; 13 | } 14 | if (stderr) { 15 | console.log(`[STDERR]: ${stderr}`); 16 | return; 17 | } 18 | console.log(`${stdout}`); 19 | }); 20 | -------------------------------------------------------------------------------- /assets/js/panel/languages.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file languages.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | Object.values(locales).forEach((locale) => { 8 | switchLang.html( 9 | switchLang.html() + 10 | ` 11 |
12 |
${locale.language} 13 |
14 |
15 | `, 16 | ); 17 | }); 18 | -------------------------------------------------------------------------------- /assets/js/checks.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file checks.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | if (navigator.userAgent !== "BDP (http://example.com), v0.0.1") { 8 | warnNotification("Please set User Agent to 'BDP (http://example.com), v0.0.1'. Visit here for more information.") 9 | } else { 10 | successNotification("All checks passed successfully.") 11 | } 12 | 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/suggestions.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Suggestions 3 | about: Here you can make suggestions for the BetterDiscordPanel Project. If you would like to create a suggestion through Discord, join the official BetterDiscordPanel server here. https://discord.gg/5SAVPAj 4 | title: "[SUGGESTION]" 5 | labels: Suggestions 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### Suggestion Type 11 | - Type: 12 | 13 | - Description: 14 | 15 | #### How would it help? 16 | 17 | #### Preview of the change 18 | - Screenshots: 19 | 20 | - Script: 21 | -------------------------------------------------------------------------------- /assets/js/main/embedLinks.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file embedLinks.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function embedLinks(element) { 8 | let html = '
'; 9 | if (element.iconURL) { 10 | html += ``; 11 | } 12 | if (element.url) { 13 | html += `${element.name}`; 14 | } else { 15 | html += element.name; 16 | } 17 | html += '
'; 18 | return html; 19 | } 20 | -------------------------------------------------------------------------------- /assets/js/panel/keypasteEvents.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file keypasteEvents.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | toSend.keypress((event) => { 8 | if (!event.shiftKey && event.key === 'Enter') { 9 | event.preventDefault(); 10 | send.click(); 11 | } 12 | event.stopPropagation(); 13 | }); 14 | 15 | toSend.on('paste', (event) => { 16 | event.preventDefault(); 17 | const text = (event.originalEvent || event).clipboardData.getData('text/plain'); 18 | document.execCommand('insertHTML', false, text); 19 | }); 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Here you can create a bug report. If you would like to report a bug through Discord, join the official BetterDiscordPanel server here. https://discord.gg/5SAVPAj 4 | title: "[BUG]" 5 | labels: Bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | #### How major is the bug from 1 - 10 11 | - Scale: 12 | 13 | #### What type of bug is it? 14 | - Type: 15 | 16 | #### Steps required to reproduce the bug 17 | - Steps: 18 | 19 | #### Screenshot (In most cases required) 20 | - Screenshot: 21 | 22 | -------------------------------------------------------------------------------- /assets/js/main/isLoggedIn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file isLoggedIn.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | let token; 8 | const status = $('#status'); 9 | 10 | status.html('Connecting to Discord Bot ...'); 11 | 12 | token = localStorage.getItem('token'); 13 | 14 | const client = new Discord.Client({ 15 | messageCacheMaxSize: 5, 16 | fetchAllMembers: false, 17 | }); 18 | 19 | client 20 | .login(token) 21 | .then(() => { 22 | status.html('Ready!'); 23 | setTimeout(function() { 24 | $('.preloader').fadeOut(300, function() {}); 25 | }, 1500); 26 | }) 27 | .catch((err) => { 28 | status.html('ERROR! Invalid Token!'); 29 | location.replace('login.html'); 30 | }); 31 | -------------------------------------------------------------------------------- /assets/js/main/replaceMarkdown.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file replaceMarkdown.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function replaceMarkdown(text, markdown, start, end, join) { 8 | if (text === '' || !text.includes(markdown)) { 9 | return text; 10 | } else { 11 | const content = text.split(markdown); 12 | if (content.length > 2) { 13 | for (let i = 0; i < content.length; i++) { 14 | if (i !== 0 && i % 2 !== 0 && content[i] !== '') { 15 | content[i] = start + content[i] + end; 16 | } else if (i !== 0 && i % 2 !== 0 && content[i] === '') { 17 | content[i] = join + join; 18 | } 19 | } 20 | return content.join(''); 21 | } else { 22 | return content.join(join); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assets/js/main/deleteMessage.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file deleteMessage.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | function delMsg(id) { 8 | const guilds = $('.guilds'); 9 | const channels = $('.channels'); 10 | let channel; 11 | 12 | if (guilds.val() === 'DM') { 13 | channel = client.channels.cache.find( 14 | (channel) => 15 | channel.type === 'dm' && channel.recipient.id === channels.val(), 16 | ); 17 | } else { 18 | const guild = client.guilds.cache.find((g) => g.id === guilds.val()); 19 | channel = guild.channels.cache.find((c) => c.id === channels.val()); 20 | } 21 | const message = channel.messages.cache.find((m) => m.id === id); 22 | 23 | if (!message.deletable) { 24 | return; 25 | } 26 | 27 | message.delete().catch((e) => { 28 | console.log(e); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /assets/js/panel/constants.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file constants.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | $('html').attr('lang', translation.langCode); 8 | 9 | const guilds = $('.guilds'); 10 | const channels = $('.channels'); 11 | const channelName = $('.channelName'); 12 | const chat = $('#chat'); 13 | const toSend = $('#toSend'); 14 | const lastMessages = $('#lastMessages'); 15 | const clearChat = $('#clearChat'); 16 | const send = $('#send'); 17 | const guildName = $('.guildName'); 18 | const guildNameNoPic = $('.guildNameNoPic'); 19 | const guildPic = $('.guildPic'); 20 | const leaveGuild = $('#leaveGuild'); 21 | const inviteBtn = $('#inviteBtn'); 22 | const refreshToken = $('.refreshToken'); 23 | const refreshChat = $('#refreshChat'); 24 | const overlay = $('#overlay-content'); 25 | const switchLang = $('#switchLang'); 26 | const changeUsername = $('#changeUsername'); 27 | -------------------------------------------------------------------------------- /assets/js/main/translator.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file translator.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | let locale; 8 | if (!Object.keys(locales).includes(localStorage.getItem('locale'))) { 9 | localStorage.setItem('locale', 'en'); 10 | } 11 | locale = localStorage.getItem('locale'); 12 | const translation = locales[locale]; 13 | 14 | Object.keys(locales['en']).forEach((key) => { 15 | if (typeof locales['en'][key] === 'string') { 16 | if (translation[key] === ('' || undefined)) { 17 | translation[key] = locales['en'][key]; 18 | } 19 | } else if (typeof locales['en'][key] === 'object') { 20 | if (!translation[key]) { 21 | translation[key] = locales['en'][key]; 22 | } 23 | } else { 24 | Object.keys(locales['en'][key]).forEach((subKey) => { 25 | if (translation[key][subKey] === ('' || undefined)) { 26 | translation[key][subKey] = locales['en'][key][subKey]; 27 | } 28 | }); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /assets/js/pages/index.init.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file index.init.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | $(document).ready(function() { 8 | $('.popup-img').magnificPopup({ 9 | type: 'image', 10 | closeOnContentClick: !0, 11 | mainClass: 'mfp-img-mobile', 12 | image: { 13 | verticalFit: !0, 14 | }, 15 | }), 16 | $('#user-status-carousel').owlCarousel({ 17 | items: 4, 18 | loop: !1, 19 | margin: 16, 20 | nav: !1, 21 | dots: !1, 22 | }), 23 | $('#user-profile-hide').click(function() { 24 | $('.user-profile-sidebar').hide(); 25 | }), 26 | $('.user-profile-show').click(function() { 27 | $('.user-chat').addClass('user-chat-show'); 28 | $('.user-profile-sidebar').show(); 29 | }), 30 | $('.channels').click(function() { 31 | $('.user-chat').addClass('user-chat-show'); 32 | }), 33 | $('.user-chat-remove').click(function() { 34 | $('.user-chat').removeClass('user-chat-show'); 35 | }); 36 | }); 37 | -------------------------------------------------------------------------------- /locales/template/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "welcome": "", 3 | "select_option": "", 4 | 5 | "start_web": "", 6 | "start_desktop": "", 7 | 8 | "support": "", 9 | "settings": "", 10 | "update": "", 11 | "language": "", 12 | "go_back": "", 13 | "done": "", 14 | "exit": "", 15 | 16 | "discordserver": "", 17 | "submit_issue": "", 18 | 19 | "betterdiscordpanel_help":"", 20 | "desktop_panel_help": "", 21 | "settings_help": "", 22 | "exit_help": "", 23 | "support_help": "", 24 | "update_help": "", 25 | "language_help": "", 26 | "go_back_help": "", 27 | "discord_help": "", 28 | "issue_help": "", 29 | "get_help": "", 30 | 31 | "check_installation": "", 32 | "checking_failure": "", 33 | "checking_system": "", 34 | "check_success": "", 35 | "updating": "", 36 | "updating_failure": "", 37 | "check_index": "", 38 | "check_main": "", 39 | "check_repo_download_method": "", 40 | "booting": "" 41 | } 42 | 43 | -------------------------------------------------------------------------------- /assets/js/panel/buttonEvents.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file buttonEvents.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | refreshToken.click(() => { 8 | if (window.confirm(translation.token.confirmation)) { 9 | localStorage.setItem('token', ''); 10 | localStorage.setItem('isLoggedIn', '0'); 11 | location.replace('login.html'); 12 | } 13 | }); 14 | 15 | send.click(() => { 16 | sendMessage(); 17 | }); 18 | 19 | clearChat.click(() => { 20 | localStorage.setItem('lastMessages', ''); 21 | $('#lastMessages').empty(); 22 | }); 23 | 24 | leaveGuild.click(() => { 25 | if (guilds.val() !== 'DM') { 26 | if (window.confirm(translation.token.confirmation)) { 27 | client.guilds.cache 28 | .find((guild) => guild.id === guilds.val()) 29 | .leave() 30 | .catch(() => { 31 | tempChange('#leaveGuild', `[${translation.errors.error}]`, 1000); 32 | }); 33 | } 34 | } 35 | }); 36 | 37 | refreshChat.click(() => { 38 | updateChannel(); 39 | }); 40 | -------------------------------------------------------------------------------- /assets/libs/owl.carousel/assets/owl.theme.default.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Owl Carousel v2.3.4 3 | * Copyright 2013-2018 David Deutsch 4 | * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 5 | */ 6 | .owl-theme .owl-dots,.owl-theme .owl-nav{text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-nav{margin-top:10px}.owl-theme .owl-nav [class*=owl-]{color:#FFF;font-size:14px;margin:5px;padding:4px 7px;background:#D6D6D6;display:inline-block;cursor:pointer;border-radius:3px}.owl-theme .owl-nav [class*=owl-]:hover{background:#869791;color:#FFF;text-decoration:none}.owl-theme .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-nav.disabled+.owl-dots{margin-top:10px}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#D6D6D6;display:block;-webkit-backface-visibility:visible;transition:opacity .2s ease;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#869791} -------------------------------------------------------------------------------- /docs/prerequisites/prerequisites.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## 🛠 Prerequisites 4 | 5 | ⚠️ **UPDATE**: Discord has updated how their servers get requests. Discord only allows requests from their own domains and APIs. In order to use BetterDiscordPanel, you must set a custom User Agent. 6 | 7 | Unfortunately, this has to be set every time you open up BetterDiscordPanel. A solution is currently being worked on for this. 8 | 9 | ### Setting a custom User Agent in Chrome 10 | 11 | 1. Open Chrome's `developer console`. You can press the Ctrl + Shift + I keys. 12 | 13 | 2. Click on the icon of the dots in the top right corner. 14 | 15 | ![Step 1](./images/step-1.png) 16 | 17 | 3. Click on `More tools`, then `Network conditions`. 18 | 19 | ![Step 1](./images/step-2.png) 20 | 21 | 4. Scroll down to the User agent section and unclick the checkbox labelled `Use browser default`. Make sure the User Agent is set to `Custom`. 22 | 23 | ![Step 3](./images/step-3.png) 24 | 25 | 5. Enter the following custom User agent. This User Agent must be specifically applied. 26 | 27 | `BDP (http://example.com), v0.0.1` 28 | 29 | 6. Start using BetterDiscordPanel! 30 | -------------------------------------------------------------------------------- /assets/js/login/loginscreen.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @file loginscreen.js 3 | * @author Sanjay Sunil 4 | * @license GPL-3.0 5 | */ 6 | 7 | $(function() { 8 | $('#container').append('