├── assets ├── body.ttf ├── icon.ico ├── icon.png ├── logo.ttf ├── plus.png ├── blank.png ├── body.woff ├── icon.icns ├── logo.woff ├── wumpus.gif ├── placeholder.png ├── wumpsearch.gif ├── iconTemplate.png └── iconTemplate@2.png ├── .github ├── funding.yml ├── dependabot.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ └── codeql-analysis.yml ├── signIn.js ├── themes ├── amoled.css ├── dark.css ├── dracula.css ├── nord.css ├── gruvbox.css ├── rebrand.css ├── rosebox.css ├── rosepine.css ├── gruvboxlight.css ├── rosepinemoon.css ├── light.css ├── rosepinedawn.css └── pywal.css ├── locales ├── korean.json ├── simplified-chinese.json ├── punjabi.json ├── latvian.json ├── slovak.json ├── english.json ├── polish.json ├── indonesian.json ├── dutch.json ├── hungarian.json ├── german.json ├── irish.json ├── spanish.json ├── french.json ├── russian.json ├── greek.json └── faq │ ├── russian.html │ ├── french.html │ ├── polish.html │ ├── german.html │ ├── hungarian.html │ ├── english.html │ └── latvian.html ├── package.json ├── PKGBUILD ├── .gitignore ├── loading.html ├── style ├── matter.css └── normalize.css ├── clientidDetect.js ├── README.md ├── main.js ├── index.html ├── LICENSE └── preload.js /assets/body.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/body.ttf -------------------------------------------------------------------------------- /assets/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/icon.ico -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/icon.png -------------------------------------------------------------------------------- /assets/logo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/logo.ttf -------------------------------------------------------------------------------- /assets/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/plus.png -------------------------------------------------------------------------------- /assets/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/blank.png -------------------------------------------------------------------------------- /assets/body.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/body.woff -------------------------------------------------------------------------------- /assets/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/icon.icns -------------------------------------------------------------------------------- /assets/logo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/logo.woff -------------------------------------------------------------------------------- /assets/wumpus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/wumpus.gif -------------------------------------------------------------------------------- /assets/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/placeholder.png -------------------------------------------------------------------------------- /assets/wumpsearch.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/wumpsearch.gif -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | liberapay: ThatOneCalculator 2 | custom: https://buymeacoffee.com/that1calculator 3 | -------------------------------------------------------------------------------- /assets/iconTemplate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/iconTemplate.png -------------------------------------------------------------------------------- /assets/iconTemplate@2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmfunc/DiscordRPCMaker/main/assets/iconTemplate@2.png -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: Windows 10 25 | - Output of `node --version` 26 | - Project version [e.g. 1.4.6] 27 | 28 | **Additional context** 29 | Add any other context about the problem here. 30 | -------------------------------------------------------------------------------- /signIn.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron') 2 | // const keytar = require('keytar') 3 | 4 | document.addEventListener("DOMContentLoaded", () => { 5 | const targetNode = document.body; 6 | 7 | // Options for the observer (which mutations to observe) 8 | let config = { characterData: true, attributes: true, childList: true, subtree: true }; 9 | 10 | // Create an observer instance linked to the callback function 11 | const observer = new MutationObserver(callback); 12 | 13 | // Start observing the target node for configured mutations 14 | observer.observe(targetNode, config); 15 | 16 | }) 17 | 18 | document.addEventListener("click", () => { 19 | callback() 20 | }) 21 | 22 | const callback = function (mutationsList) { 23 | console.log("change") 24 | if (document.getElementById("display_result").value !== "") { 25 | console.log() 26 | } 27 | } -------------------------------------------------------------------------------- /themes/amoled.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #7289da; 3 | --primary-shade: #5c6fb1; 4 | --primary-darker: #6C83D0; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #4e5d94; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #43b581; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #f04747; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #ffffff; 14 | --background-primary: #000000; 15 | --background-secondary: #000000; 16 | --background-tertiary: #000000; 17 | --background-floating: #000000; 18 | --interactive: #b9bbbe; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #dcddde; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #677bc4; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #d84040; 25 | --BTN-danger-active-background: #c03939; 26 | --BTN-success-hover-background: #3ca374; 27 | --BTN-success-active-background: #35976b; 28 | } -------------------------------------------------------------------------------- /themes/dark.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #7289da; 3 | --primary-shade: #5c6fb1; 4 | --primary-darker: #6C83D0; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #4e5d94; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #43b581; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #f04747; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #ffffff; 14 | --background-primary: #36393f; 15 | --background-secondary: #303338; 16 | --background-tertiary: #202225; 17 | --background-floating: #18191c; 18 | --interactive: #b9bbbe; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #dcddde; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #677bc4; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #d84040; 25 | --BTN-danger-active-background: #c03939; 26 | --BTN-success-hover-background: #3ca374; 27 | --BTN-success-active-background: #35976b; 28 | } -------------------------------------------------------------------------------- /themes/dracula.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #282a36; 3 | --primary-shade: #21232e; 4 | --primary-darker: #1d1f29; 5 | --primary-hover: rgba(68, 71, 90, 0.1); 6 | --primary-active: #6272a4; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #50fa7b; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #ff5555; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #f8f8f2; 14 | --background-primary: #353744; 15 | --background-secondary: #313442; 16 | --background-tertiary: #222531; 17 | --background-floating: #11121a; 18 | --interactive: #b9bbbe; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #dcddde; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #6272a4; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #e74343; 25 | --BTN-danger-active-background: #c53333; 26 | --BTN-success-hover-background: #2da34b; 27 | --BTN-success-active-background: #35976b; 28 | } -------------------------------------------------------------------------------- /themes/nord.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #82A2C0; 3 | --primary-shade: #5E81AC; 4 | --primary-darker: #5E81AC; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #82A2C0; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #A4BD8E; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #BD626B; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #E5E9F0; 14 | --background-primary: #2E3440; 15 | --background-secondary: #3B4251; 16 | --background-tertiary: #3B4251; 17 | --background-floating: #3B4251; 18 | --interactive: #D8DEE9; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #ECEFF4; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #82A2C0; 23 | --BTN-primary-active-background: #8AC0CF; 24 | --BTN-danger-hover-background: #a8535b; 25 | --BTN-danger-active-background: #BD626B; 26 | --BTN-success-hover-background: #93aa7e; 27 | --BTN-success-active-background: #A4BD8E; 28 | } -------------------------------------------------------------------------------- /themes/gruvbox.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #458588; 3 | --primary-shade: #83A598; 4 | --primary-darker: #83A598; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #83A598; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #98971A; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #CC241D; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #EBDBB2; 14 | --background-primary: #282828; 15 | --background-secondary: #1D2021; 16 | --background-tertiary: #1D2021; 17 | --background-floating: #32302F; 18 | --interactive: #A89984; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #BDAE93; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #B16286; 23 | --BTN-primary-active-background: #D3869B; 24 | --BTN-danger-hover-background: #d84040; 25 | --BTN-danger-active-background: #c03939; 26 | --BTN-success-hover-background: #689D6A; 27 | --BTN-success-active-background: #8EC07C; 28 | } -------------------------------------------------------------------------------- /themes/rebrand.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #5865F2; 3 | --primary-shade: #404EED; 4 | --primary-darker: #404EED; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #404EED; 7 | --secondary: #BED3FF; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #57F287; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #ED4245; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #ffffff; 14 | --background-primary: #292841; 15 | --background-secondary: #1C1B29; 16 | --background-tertiary: #1C1B29; 17 | --background-floating: #23272A; 18 | --interactive: #b9bbbe; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #dcddde; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #5865F2; 23 | --BTN-primary-active-background: #4752C4; 24 | --BTN-danger-hover-background: #ED4245; 25 | --BTN-danger-active-background: #c03939; 26 | --BTN-success-hover-background: #57F287; 27 | --BTN-success-active-background: #35976b; 28 | } -------------------------------------------------------------------------------- /themes/rosebox.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #A57562; 3 | --primary-shade: #5E4C44; 4 | --primary-darker: #5E4C44; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #D08770; 7 | --secondary: #E6DDDC; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #A3BE8C; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #BF616A; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #A3A5AA; 14 | --background-primary: #262626; 15 | --background-secondary: #222222; 16 | --background-tertiary: #222222; 17 | --background-floating: #232323; 18 | --interactive: #E6DDDC; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #dcddde; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #677bc4; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #a7575f; 25 | --BTN-danger-active-background: #91464e; 26 | --BTN-success-hover-background: #88a36f; 27 | --BTN-success-active-background: #60744d; 28 | } -------------------------------------------------------------------------------- /themes/rosepine.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #c4a7e7; 3 | --primary-shade: #31748f; 4 | --primary-darker: #31748f; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #9ccfd8; 7 | --secondary: #6e6a86; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #f6c177; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #eb6f92; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #e0def4; 14 | --background-primary: #1f1d2e; 15 | --background-secondary: #191724; 16 | --background-tertiary: #191724; 17 | --background-floating: #191724; 18 | --interactive: #59546d; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #817c9c; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #9777be; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #b4637a; 25 | --BTN-danger-active-background: #a74964; 26 | --BTN-success-hover-background: #ea9d34; 27 | --BTN-success-active-background: #aa8147; 28 | } -------------------------------------------------------------------------------- /themes/gruvboxlight.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #458588; 3 | --primary-shade: #83A598; 4 | --primary-darker: #83A598; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #83A598; 7 | --secondary: #7C6F64; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #98971A; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #CC241D; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #3C3836; 14 | --background-primary: #FBF1C7; 15 | --background-secondary: #F2E5BC; 16 | --background-tertiary: #F2E5BC; 17 | --background-floating: #F9F5D7; 18 | --interactive: #A89984; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #928374; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #B16286; 23 | --BTN-primary-active-background: #D3869B; 24 | --BTN-danger-hover-background: #d84040; 25 | --BTN-danger-active-background: #c03939; 26 | --BTN-success-hover-background: #689D6A; 27 | --BTN-success-active-background: #8EC07C; 28 | } -------------------------------------------------------------------------------- /themes/rosepinemoon.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #c4a7e7; 3 | --primary-shade: #31748f; 4 | --primary-darker: #31748f; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #9ccfd8; 7 | --secondary: #817c9c; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #f6c177; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #ea9a97; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #e0def4; 14 | --background-primary: #2a273f; 15 | --background-secondary: #232136; 16 | --background-tertiary: #232136; 17 | --background-floating: #232136; 18 | --interactive: #59546d; 19 | --interactive-active: var(--text); 20 | --interactive-hover: #817c9c; 21 | /* Begin fosscord specific */ 22 | --BTN-primary-hover-background: #9777be; 23 | --BTN-primary-active-background: #5b6eae; 24 | --BTN-danger-hover-background: #eb6f92; 25 | --BTN-danger-active-background: #b4637a; 26 | --BTN-success-hover-background: #ea9d34; 27 | --BTN-success-active-background: #aa8147; 28 | } -------------------------------------------------------------------------------- /themes/light.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #7289da; 3 | --primary-shade: #5c6fb1; 4 | --primary-darker: #6C83D0; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #4e5d94; 7 | --secondary: #747f8d; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #43b581; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #f04747; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #0B0D0A; 14 | --TEXT-secondary: var(--text) !important; 15 | --background-primary: #EAEAE9; 16 | --background-secondary: #EBEBEB; 17 | --background-tertiary: #D2D2D1; 18 | --background-floating: #D2D2D1; 19 | --interactive: #0B0D0A; 20 | --interactive-active: var(--text); 21 | --interactive-hover: #dcddde; 22 | /* Begin fosscord specific */ 23 | --BTN-primary-hover-background: #677bc4; 24 | --BTN-primary-active-background: #5b6eae; 25 | --BTN-danger-hover-background: #d84040; 26 | --BTN-danger-active-background: #c03939; 27 | --BTN-success-hover-background: #3ca374; 28 | --BTN-success-active-background: #35976b; 29 | } -------------------------------------------------------------------------------- /themes/rosepinedawn.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --primary: #907aa9; 3 | --primary-shade: #286983; 4 | --primary-darker: #56949f; 5 | --primary-hover: rgba(114, 137, 218, 0.1); 6 | --primary-active: #56949f; 7 | --secondary: #6e6a86; 8 | --secondary-hover: rgba(116, 127, 141, 0.1); 9 | --success: #ea9d34; 10 | --success-hover: rgba(67, 181, 129, 0.1); 11 | --danger: #b4637a; 12 | --danger-hover: rgba(240, 71, 71, 0.1); 13 | --text: #575279; 14 | --background-primary: #fffaf3; 15 | --background-secondary: #f2e9de; 16 | --background-tertiary: #f2e9de; 17 | --background-floating: #f2e9de; 18 | --interactive: #575279; 19 | --interactive-active: var(--text); 20 | --TEXT-secondary: var(--text) !important; 21 | --interactive-hover: #817c9c; 22 | /* Begin fosscord specific */ 23 | --BTN-primary-hover-background: #907aa9; 24 | --BTN-primary-active-background: #5b6eae; 25 | --BTN-danger-hover-background: #b4637a; 26 | --BTN-danger-active-background: #a74964; 27 | --BTN-success-hover-background: #ea9d34; 28 | --BTN-success-active-background: #aa8147; 29 | } -------------------------------------------------------------------------------- /themes/pywal.css: -------------------------------------------------------------------------------- 1 | @import url(file://HOMEDIR/.cache/wal/colors.css); 2 | 3 | :root { 4 | --primary: var(--color4); 5 | --primary-shade: var(--color5); 6 | --primary-darker: var(--color5); 7 | --primary-hover: rgba(114, 137, 218, 0.1); 8 | --primary-active: var(--color6); 9 | --secondary: var(--color15); 10 | --secondary-hover: rgba(116, 127, 141, 0.1); 11 | --success: var(--color2); 12 | --success-hover: rgba(67, 181, 129, 0.1); 13 | --danger: var(--color1); 14 | --danger-hover: rgba(240, 71, 71, 0.1); 15 | --text: var(--foreground); 16 | --background-primary: var(--background); 17 | --background-secondary: var(--color0); 18 | --background-tertiary: var(--color0); 19 | --background-floating: var(--color8); 20 | --interactive: var(--color7); 21 | --interactive-active: var(--text); 22 | --interactive-hover: var(--color15); 23 | /* Begin fosscord specific */ 24 | --BTN-primary-hover-background: var(--color5); 25 | --BTN-primary-active-background: var(--color5); 26 | --BTN-danger-hover-background: var(--color1); 27 | --BTN-danger-active-background: var(--color1); 28 | --BTN-success-hover-background: var(--color2); 29 | --BTN-success-active-background: var(--color2); 30 | } -------------------------------------------------------------------------------- /locales/korean.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "justiceserv", 3 | "language": "한국어", 4 | "loading": "로딩중...", 5 | "nointernet": "Discord RPC Maker를 사용하기 위해서는 인터넷에 연결해야합니다.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "저장된 활동 상태(들)", 8 | "logo": "Discord RPC Maker", 9 | "devel": "개발자 포털", 10 | "save": "저장", 11 | "test": "활동 상태 시작하기", 12 | "client-id": "클라이언트 ID", 13 | "client-id-placeholder": "클라이언트 ID", 14 | "large-image": "메인 이미지", 15 | "large-image-placeholder": "메인 이미지 이름 (선택 사항)", 16 | "small-image": "서브 이미지", 17 | "small-image-placeholder": "서브 이미지 이름 (선택 사항, 메인 이미지가 있을때만 적어주세요)", 18 | "description-1": "활동 상태 소개줄", 19 | "description-1-placeholder": "활동 상태에 나타날 소개줄 1 (선택 사항)", 20 | "description-2": "활동 상태 소개줄", 21 | "description-2-placeholder": "활동 상태에 나타날 소개줄 2 (선택 사항)", 22 | "button-1": "버튼 1", 23 | "button-2": "버튼 2", 24 | "button-1-label": "라벨", 25 | "button-1-url": "링크", 26 | "button-2-label": "라벨", 27 | "button-2-url": "링크", 28 | "del-btn": "활동 상태 설정 지우기", 29 | "file-btn": "파일 탐색기에서 보기", 30 | "preview-name": "자신의 활동 상태", 31 | "preview-playingagame": "~~ 하는 중", 32 | "preview-title": "애플리케이션 이름", 33 | "base-flyout": "원하는 애플리케이션으로 가시면, 클라이언트 ID가 자동으로 복사됩니다. ", 34 | "detected-flyout": "클라이언트 ID 감지! 클립보드로 복사했습니다.", 35 | "flush-zNaLgf": "'New Application'을 클릭해서 새 애플리케이션을 만들거나, 이미 만들어진 애플리케이션을 선택해주세요.'", 36 | "wordmark-1G98vs": "Discord RPC Developer Portal", 37 | "aaa-innertext": "활동 상태 미리보기" 38 | } -------------------------------------------------------------------------------- /locales/simplified-chinese.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "macpherson", 3 | "language": "简体华文", 4 | "loading": "请等", 5 | "nointernet": "请您连接到互联网以继续,谢谢!", 6 | "title": "Discord Presence 开发者门户", 7 | "presence-title": "您创造的 Presences", 8 | "logo": "Discord Presence 开发者门户", 9 | "presence-name": "Presence 的名称", 10 | "presence-name-placeholder": "Presence 的名称", 11 | "devel": "Developer Portal", 12 | "save": "保存", 13 | "test": "开展您的 Presence", 14 | "client-id": "Presence 的 ID", 15 | "client-id-placeholder": "Presence 的 ID", 16 | "large-image": "大图", 17 | "large-image-placeholder": "大图的名字 (非强制的)", 18 | "small-image": "小图", 19 | "small-image-placeholder": "小图的名字 (非强制的,也需要一个大图)", 20 | "description-1": "工具提示", 21 | "description-1-placeholder": "工具提示第一行 (非强制的)", 22 | "description-2": "工具提示", 23 | "description-2-placeholder": "工具提示第二行 (非强制的)", 24 | "button-1": "第一按钮", 25 | "button-2": "第二按钮", 26 | "button-1-label": "按钮一标签", 27 | "button-1-url": "网址", 28 | "button-2-label": "按钮耳标签", 29 | "button-2-url": "网址", 30 | "del-btn": "取消 Presence", 31 | "file-btn": "显示在文件中", 32 | "preview-name": "您", 33 | "preview-playingagame": "正在玩", 34 | "preview-title": "您的 presence 的名称", 35 | "base-flyout": "选择您的 presence ,它的 ID 会自动地被检测到!", 36 | "detected-flyout": "检测到 presence 的 ID,把它抄到剪贴板上!", 37 | "flush-zNaLgf": "按 'New Application' 以创造一个新的 presence,或选一个以及创造的 presence 在下面。", 38 | "wordmark-1G98vs": "Discord Presence 开发者门户", 39 | "aaa-innertext": "这就是您的 presence 的名称。" 40 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discordrpcmaker", 3 | "version": "2.0.9", 4 | "description": "Cross-platform Discord Rich Presence Generator, WITH BUTTONS!", 5 | "main": "./main.js", 6 | "bin": { 7 | "rpcmaker": "./main.js" 8 | }, 9 | "scripts": { 10 | "run": "node ./main.js && exit 1", 11 | "start": "electron main.js" 12 | }, 13 | "keywords": [ 14 | "discord", 15 | "rpc", 16 | "discord-rpc", 17 | "cli", 18 | "rich-presence", 19 | "richpresence", 20 | "rpcmaker", 21 | "drpc", 22 | "discordrpcmaker" 23 | ], 24 | "author": { 25 | "name": "ThatOneCalculator", 26 | "email": "kainoa@t1c.dev", 27 | "url": "https://t1c.dev/" 28 | }, 29 | "funding": { 30 | "type": "individual", 31 | "url": "https://buymeacoffee.com/that1calculator" 32 | }, 33 | "license": "GPL-3.0-or-later", 34 | "bugs": { 35 | "url": "https://github.com/ThatOneCalculator/DiscordRPCMaker/issues", 36 | "email": "kainoa@t1c.dev" 37 | }, 38 | "homepage": "https://github.com/ThatOneCalculator/DiscordRPCMaker", 39 | "repository": "https://github.com/ThatOneCalculator/DiscordRPCMaker", 40 | "dependencies": { 41 | "@electron/remote": "^1.1.0", 42 | "child_process": "^1.0.2", 43 | "copy-to-clipboard": "^3.3.1", 44 | "discord-rpc": "^4.0.1", 45 | "latest-version": "^5.1.0", 46 | "open-file-explorer": "^1.0.2" 47 | }, 48 | "pkg": { 49 | "assets": [ 50 | "./node_modules/" 51 | ] 52 | }, 53 | "devDependencies": { 54 | "electron": "^13.0.0", 55 | "electron-builder": "^22.10.5", 56 | "fs": "^0.0.1-security" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /locales/punjabi.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Toxician", 3 | "language": "ਪੰਜਾਬੀ", 4 | "loading": "ਲੋਡਿੰਗ", 5 | "nointernet": "ਕਿਰਪਾ ਕਰਕੇ ਕਲੇਸ਼ ਆਰਪੀਸੀ ਮੇਕਰ ਦੀ ਵਰਤੋਂ ਕਰਨ ਲਈ ਇੰਟਰਨੈੱਟ ਨਾਲ ਕਨੈਕਟ ਕਰੋ.", 6 | "title": "ਕਲੇਸ਼ ਆਰਪੀਸੀ ਨਿਰਮਾਤਾ", 7 | "presence-title": "ਸੁਰੱਖਿਅਤ ਮੌਜੂਦਗੀ", 8 | "logo": "ਕਲੇਸ਼ ਆਰਪੀਸੀ ਨਿਰਮਾਤਾ", 9 | "presence-name": "ਮੌਜੂਦਗੀ ਦਾ ਨਾਮ", 10 | "presence-name-placeholder": "ਮੌਜੂਦਗੀ ਦਾ ਨਾਮ", 11 | "devel": "ਡਿਵੈਲਪਰ ਪੋਰਟਲ", 12 | "save": "ਬੱਚਤ", 13 | "test": "ਲਾਂਚ ਮੌਜੂਦਗੀ", 14 | "client-id": "ਗਾਹਕ ਆਈਡੀ", 15 | "client-id-placeholder": "ਗਾਹਕ ਆਈਡੀ", 16 | "large-image": "ਵੱਡਾ ਚਿੱਤਰ", 17 | "large-image-placeholder": "ਵੱਡਾ ਚਿੱਤਰ ਨਾਮ (ਵਿਕਲਪਕ)", 18 | "small-image": "ਛੋਟਾ ਚਿੱਤਰ", 19 | "small-image-placeholder": "ਛੋਟਾ ਚਿੱਤਰ ਨਾਮ (ਵਿਕਲਪਕ, ਕੇਵਲ ਤਾਂ ਹੀ ਜੇ ਤੁਹਾਡੇ ਕੋਲ ਕੋਈ ਵੱਡਾ ਚਿੱਤਰ ਹੈ)", 20 | "description-1": "ਵਰਣਨ", 21 | "description-1-placeholder": "ਵਰਣਨ ਲਾਈਨ 1 (ਵਿਕਲਪਕ)", 22 | "description-2": "ਵਰਣਨ", 23 | "description-2-placeholder": "ਵਰਣਨ ਲਾਈਨ 2 (ਵਿਕਲਪਕ)", 24 | "button-1": "ਬਟਨ 1", 25 | "button-2": "ਬਟਨ 2", 26 | "button-1-label": "ਲੇਬਲ", 27 | "button-1-url": "ਯੂਆਰਐਲ", 28 | "button-2-label": "ਲੇਬਲ", 29 | "button-2-url": "ਯੂਆਰਐਲ", 30 | "del-btn": "ਮੌਜੂਦਗੀ ਨੂੰ ਮਿਟਾਓ", 31 | "file-btn": "ਫਾਇਲਾਂ ਵਿੱਚ ਦਿਖਾਓ", 32 | "preview-name": "ਤੁਸੀਂ", 33 | "preview-playingagame": "ਇੱਕ ਗੇਮ ਖੇਡਣਾ", 34 | "preview-title": "ਤੁਹਾਡੀ ਐਪ ਦਾ ਨਾਮ", 35 | "base-flyout": "ਆਪਣੀ ਲੋੜੀਂਦੀ ਐਪਲੀਕੇਸ਼ਨ 'ਤੇ ਜਾਓ, ਅਤੇ ਗਾਹਕ ਆਈਡੀ ਦਾ ਆਪਣ ਆਪ ਪਤ ਲਗਇਆ ਜਵਗ! ", 36 | "detected-flyout": "ਲਭਆ ਗਹਕ ਆਈਡ, ਕਲਪਬਰਡ ਵਚ ਕਪ ਕਤ ਗਆ!", 37 | "flush-zNaLgf": "ਨਵ ਮਜਦਗ ਬਣਉਣ ਲਈ 'ਨਵ ਐਪਲਕਸਨ' 'ਤ ਕਲਕ ਕਰ, ਜ ਹਠ ਪਹਲ ਤ ਬਣਏ ਗਏ ਇਕ ਦ ਚਣ ਕਰ", 38 | "wordmark-1G98vs": "ਕਲਸ ਆਰਪਸ ਡਵਲਪਰ ਪਰਟਲ", 39 | "aaa-innertext": "ਇਹ ਉਹ ਹ ਜਸ ਨ ਤਹਡ ਮਜਦਗ ਕਹ ਜਵਗ।" 40 | } -------------------------------------------------------------------------------- /locales/latvian.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Laaru", 3 | "language": "Latvija", 4 | "loading": "Lādējās", 5 | "nointernet": "Lūdzu savienojaties ar internetu lai izmantotu Discord RPC Maker.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Saglabātās klātbūtnes", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Klātbūtnes vards", 10 | "presence-name-placeholder": "Klātbūtnes vards", 11 | "devel": "Izstrādātāju portāls", 12 | "save": "Saglabāt", 13 | "test": "Uzsākt klātbūtni", 14 | "client-id": "Klienta ID", 15 | "client-id-placeholder": "Klienta ID", 16 | "large-image": "Liels attēls", 17 | "large-image-placeholder": "Liela attēla vards (neobligāti)", 18 | "small-image": "Mazs attēls", 19 | "small-image-placeholder": "Maza attēla vards (neobligāti, only if you have a large image)", 20 | "description-1": "Apraksts", 21 | "description-1-placeholder": "Apraksts līnija 1 (neobligāti)", 22 | "description-2": "Apraksts", 23 | "description-2-placeholder": "Apraksts līnija 2 (neobligāti)", 24 | "button-1": "Poga 1", 25 | "button-2": "Poga 2", 26 | "button-1-label": "Etiķete", 27 | "button-1-url": "url", 28 | "button-2-label": "Etiķete", 29 | "button-2-url": "url", 30 | "del-btn": "Dzēst klātbūtni", 31 | "file-btn": "Rādīt failos", 32 | "preview-name": "Jūs", 33 | "preview-playingagame": "SPĒLE SPĒLI", 34 | "preview-title": "Jūsu lietotnes nosaukums", 35 | "base-flyout": "Dodieties uz vēlamo lietojumprogrammu, un klienta ID tiks automātiski noteikts! ", 36 | "detected-flyout": "Noteikts klienta ID, nokopēts starpliktuvē!", 37 | "flush-zNaLgf": "Noklikšķiniet uz 'Jauna lietojumprogramma' lai izveidotu jaunu klātbūtni, vai zemāk atlasiet jau izveidotu", 38 | "wordmark-1G98vs": "Discord RPC izstrādātāju portāls", 39 | "aaa-innertext": "Tā tiks saukta jūsu klātbūtne." 40 | } -------------------------------------------------------------------------------- /locales/slovak.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "KraXen72", 3 | "language": "Slovenčina", 4 | "loading": "Načítavam", 5 | "nointernet": "Pripojenie na internet zlyhalo", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Uložené Prezencie", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Názov Prezencie", 10 | "presence-name-placeholder": "Názov Prezencie", 11 | "devel": "Vývojárský Portál", 12 | "save": "Uložiť", 13 | "test": "Spustiť prezenciu", 14 | "client-id": "Client ID", 15 | "client-id-placeholder": "Client ID", 16 | "large-image": "Veľký obrázok", 17 | "large-image-placeholder": "Meno veľkého obrázku (nepovinné)", 18 | "small-image": "Malý obrázok", 19 | "small-image-placeholder": "Meno malého obrázku (nepovinné, iba ak máte aj veľký obrázok)", 20 | "description-1": "Popis", 21 | "description-1-placeholder": "Popis riadok 1 (nepovinné)", 22 | "description-2": "Popis", 23 | "description-2-placeholder": "Popis riadok 2 (nepovinné)", 24 | "button-1": "Tlačidlo 1", 25 | "button-2": "Tlačidlo 2", 26 | "button-1-label": "Text", 27 | "button-1-url": "url", 28 | "button-2-label": "Text", 29 | "button-2-url": "url", 30 | "del-btn": "Zmazať Prezenciu", 31 | "file-btn": "Otvoriť v súboroch", 32 | "preview-name": "Ty", 33 | "preview-playingagame": "Hrá hru", 34 | "preview-title": "Meno vašej aplikácie", 35 | "base-flyout": "Zvoľte vašu vybranú aplikáciu, a Client ID bude automaticky detekované! ", 36 | "detected-flyout": "Detekovali sme Client ID a skopírovali do schránky!", 37 | "flush-zNaLgf": "Kliknite 'New Application' Na vytvorenie prezencie, alebo zvoľte už vytvorenú nižšie", 38 | "wordmark-1G98vs": "Discord RPC Vývojárský Portál", 39 | "aaa-innertext": "Takto sa bude vaša prezencia volať." 40 | } -------------------------------------------------------------------------------- /locales/english.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "ThatOneCalculator", 3 | "language": "English", 4 | "loading": "Loading", 5 | "nointernet": "Please connect to the internet to use Discord RPC Maker.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Saved Presences", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Presence Name", 10 | "presence-name-placeholder": "Presence Name", 11 | "devel": "Developer Portal", 12 | "save": "Save", 13 | "test": "Launch Presence", 14 | "client-id": "Client ID", 15 | "client-id-placeholder": "Client ID", 16 | "large-image": "Large Image", 17 | "large-image-placeholder": "Large Image name (optional)", 18 | "small-image": "Small Image", 19 | "small-image-placeholder": "Small Image name (optional, only if you have a large image)", 20 | "description-1": "Description", 21 | "description-1-placeholder": "Description line 1 (optional)", 22 | "description-2": "Description", 23 | "description-2-placeholder": "Description line 2 (optional)", 24 | "button-1": "Button 1", 25 | "button-2": "Button 2", 26 | "button-1-label": "Label", 27 | "button-1-url": "url", 28 | "button-2-label": "Label", 29 | "button-2-url": "url", 30 | "del-btn": "Delete Presence", 31 | "file-btn": "Show in files", 32 | "preview-name": "You", 33 | "preview-playingagame": "PLAYING A GAME", 34 | "preview-title": "Your app's name", 35 | "base-flyout": "Go to your desired application, and the Client ID will be detected automatically! ", 36 | "detected-flyout": "Detected Client ID, copied to clipboard!", 37 | "flush-zNaLgf": "Click 'New Application' to create a new presence, or select an already created one below", 38 | "wordmark-1G98vs": "Discord RPC Developer Portal", 39 | "aaa-innertext": "This is what your presence will be called." 40 | } -------------------------------------------------------------------------------- /locales/polish.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Artugr18", 3 | "language": "Polski", 4 | "loading": "Ładowanie", 5 | "nointernet": "Aby korzystać z Discord RPC Maker, połącz się z Internetem.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Zapisane Szablony", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Nazwa szablonu", 10 | "presence-name-placeholder": "Nazwa szablonu", 11 | "devel": "Portal dewelopera", 12 | "save": "Zapisz", 13 | "test": "Uruchom szablon", 14 | "client-id": "ID Klienta", 15 | "client-id-placeholder": "ID Klienta", 16 | "large-image": "Duży obraz", 17 | "large-image-placeholder": "Nazwa dużego obrazu (opcjonalne)", 18 | "small-image": "Mały obraz", 19 | "small-image-placeholder": "Nazwa małeo obrazu (opcjonalne, tylko jeśli masz duży obraz)", 20 | "description-1": "Opis", 21 | "description-1-placeholder": "Pierwsza linia tekstu (opcjonalne)", 22 | "description-2": "Opis", 23 | "description-2-placeholder": "Druga linia tekstu (opcjonalne)", 24 | "button-1": "1 Przycisk", 25 | "button-2": "2 Przycisk", 26 | "button-1-label": "Nazwa", 27 | "button-1-url": "Adres url", 28 | "button-2-label": "Nazwa", 29 | "button-2-url": "Adres url", 30 | "del-btn": "Usuń szablon", 31 | "file-btn": "Pokaż w plikach", 32 | "preview-name": "Ty", 33 | "preview-playingagame": "W GRZE", 34 | "preview-title": "Nazwa twojej aplikacji", 35 | "base-flyout": "Przejdź do wybranej aplikacji, a ID klienta zostanie automatycznie wykryty! ", 36 | "detected-flyout": "Wykryto ID klienta, skopiowany do schowka!", 37 | "flush-zNaLgf": "Kliknij „Nowa aplikacja”, aby utworzyć nowy szablon, lub wybierz już utworzoną poniżej", 38 | "wordmark-1G98vs": "Portal deweloperów RPC Discord", 39 | "aaa-innertext": "Tak będzie się nazywać twój szablon." 40 | } -------------------------------------------------------------------------------- /locales/indonesian.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "LordKotatsu", 3 | "language": "Indonesia", 4 | "loading": "Memuat", 5 | "nointernet": "Tolong Nyalakan internet Untuk menggunakan Discord RPC Maker.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Presence Tersimpan", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Nama Presence", 10 | "presence-name-placeholder": "Nama Presence", 11 | "devel": "Developer Portal", 12 | "save": "Simpan", 13 | "test": "Jalankan Presence", 14 | "client-id": "ID Klien", 15 | "client-id-placeholder": "ID Klien", 16 | "large-image": "Gambar Besar", 17 | "large-image-placeholder": "Nama Gambar Besar (pilihan)", 18 | "small-image": "Gambar Kecil", 19 | "small-image-placeholder": "Nama Gambar Kecil (pilihan, Hanya kalau kau mempunyai gambar besar)", 20 | "description-1": "Deskripsi", 21 | "description-1-placeholder": "Garis deskripsi 1 (pilihan)", 22 | "description-2": "Deskripsi", 23 | "description-2-placeholder": "Garis deskripsi2 (pilihan)", 24 | "button-1": "Tombol 1", 25 | "button-2": "Tombol 2", 26 | "button-1-label": "Label", 27 | "button-1-url": "url website", 28 | "button-2-label": "Label", 29 | "button-2-url": "url website", 30 | "del-btn": "Hapus Presence", 31 | "file-btn": "Buka lokasi file", 32 | "preview-name": "Kamu", 33 | "preview-playingagame": "Memainkan Game", 34 | "preview-title": "Nama aplikasi mu", 35 | "base-flyout": "Buka aplikasi yang Anda inginkan, dan ID Klien akan terdeteksi secara otomatis! ", 36 | "detected-flyout": "ID Klien yang terdeteksi, disalin!", 37 | "flush-zNaLgf": "Klik 'Aplikasi Baru' untuk membuat presence baru, atau pilih yang sudah dibuat di bawah ini", 38 | "wordmark-1G98vs": "Discord RPC Developer Portal", 39 | "aaa-innertext": "Inilah sebutan untuk presence mu." 40 | } -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Kainoa Kanter 2 | # Based off of: https://daveparrish.net/posts/2019-11-16-Better-AppImage-PKGBUILD-template.html 3 | 4 | _pkgname=discordrpcmaker 5 | 6 | pkgname="${_pkgname}" 7 | pkgver=2.0.9 8 | pkgrel=1 9 | pkgdesc="Discord RPC Maker lets you make and manage custom Discord Rich Presences with buttons!" 10 | arch=('x86_64') 11 | url="https://drpcm.t1c.dev/" 12 | license=('GPL') 13 | depends=('libnotify' 'libappindicator-gtk3' 'fuse2' 'fuse3' 'fuse-common' 'libsecret') 14 | _appimage="discordrpcmaker-linux.appimage" 15 | source_x86_64=("${_appimage}::https://github.com/thatonecalculator/discordrpcmaker/releases/download/v${pkgver}/${_appimage}") 16 | noextract=("${_appimage}") 17 | sha256sums_x86_64=('01988e316572636ae77d5fe324d261880a5041ff76847fadee91261757c536ea') 18 | options+=('!strip') 19 | 20 | prepare() { 21 | chmod +x "${_appimage}" 22 | ./"${_appimage}" --appimage-extract 23 | } 24 | 25 | build() { 26 | # Adjust .desktop so it will work outside of AppImage container 27 | sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_pkgname}|"\ 28 | "squashfs-root/${_pkgname}.desktop" 29 | # Fix permissions; .AppImage permissions are 700 for all directories 30 | chmod -R a-x+rX squashfs-root/usr 31 | } 32 | 33 | package() { 34 | # AppImage 35 | install -Dm755 "${srcdir}/${_appimage}" "${pkgdir}/opt/${pkgname}/${pkgname}.AppImage" 36 | # Desktop file 37 | install -Dm644 "${srcdir}/squashfs-root/${_pkgname}.desktop"\ 38 | "${pkgdir}/usr/share/applications/${_pkgname}.desktop" 39 | 40 | # Icon images 41 | install -dm755 "${pkgdir}/usr/share/" 42 | cp -a "${srcdir}/squashfs-root/usr/share/icons" "${pkgdir}/usr/share/" 43 | 44 | # Symlink executable 45 | install -dm755 "${pkgdir}/usr/bin" 46 | ln -s "/opt/${pkgname}/${pkgname}.AppImage" "${pkgdir}/usr/bin/${_pkgname}" 47 | } 48 | -------------------------------------------------------------------------------- /locales/dutch.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Sam", 3 | "language": "Nederlands", 4 | "loading": "Laden", 5 | "nointernet": "Verbind met het internet om Discord PRC maker te gebruiken.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Presences opgeslagen", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Presence naam", 10 | "presence-name-placeholder": "Presence Naam", 11 | "devel": "Developer portaal", 12 | "save": "Opslaan", 13 | "test": "lanceer Presence", 14 | "client-id": "Client ID", 15 | "client-id-placeholder": "Client ID", 16 | "large-image": "Grote foto", 17 | "large-image-placeholder": "Naam grote foto (optioneel)", 18 | "small-image": "Kleine foto", 19 | "small-image-placeholder": "Naam kleine foto (optioneel, alleen als je een grote foto hebt)", 20 | "description-1": "Omschrijving ", 21 | "description-1-placeholder": "Omschrijving lijn 1 (optioneel)", 22 | "description-2": "Omschrijving", 23 | "description-2-placeholder": "Omschrijving lijn 2 (optioneel)", 24 | "button-1": "Knop 1", 25 | "button-2": "Knop 2", 26 | "button-1-label": "Label", 27 | "button-1-url": "url", 28 | "button-2-label": "Label", 29 | "button-2-url": "url", 30 | "del-btn": "Verwijder Presence", 31 | "file-btn": "Weergeven in bestanden", 32 | "preview-name": "Jij", 33 | "preview-playingagame": "SPEELT EEN SPEL", 34 | "preview-title": "Jou app's naam", 35 | "base-flyout": "Ga naar je gewenste applicant, en de Cliënt ID word automatisch gedetecteerd", 36 | "detected-flyout": "Gedetecteerde Client ID, gekopieerd naar je klembord", 37 | "flush-zNaLgf": "klik 'Nieuwe Applicatie' om een nieuwe presence te maken, of selecteer beneden al een die je al hebt gemaakt", 38 | "wordmark-1G98vs": "Discord RPC Developer portaal ", 39 | "aaa-innertext": "dit is wat je présence genoemd gaat worden." 40 | } -------------------------------------------------------------------------------- /locales/hungarian.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "aprobeni", 3 | "language": "Magyar", 4 | "loading": "Betöltés", 5 | "nointernet": "Kérlek csatlakozz az internethez, hogy használhasd a Discord RPC Készítőt.", 6 | "title": "Discord RPC Készítő", 7 | "presence-title": "Mentett megjelenések", 8 | "logo": "Discord RPC Készítő", 9 | "presence-name": "Megjelenés neve", 10 | "presence-name-placeholder": "Megjelenés neve", 11 | "devel": "Fejlesztői portál", 12 | "save": "Mentés", 13 | "test": "Megjelenés bekapcsolása", 14 | "client-id": "Kliens ID", 15 | "client-id-placeholder": "Kliens ID", 16 | "large-image": "Nagy kép", 17 | "large-image-placeholder": "Nagy kép neve (opcionális)", 18 | "small-image": "Kis kép", 19 | "small-image-placeholder": "Kis kép neve (opcionális, amennyiben van nagy kép beállítva)", 20 | "description-1": "Leírás", 21 | "description-1-placeholder": "A leírás első sora (opcionális)", 22 | "description-2": "Leírás", 23 | "description-2-placeholder": "A leírás második sora (opcionális)", 24 | "button-1": "Gomb 1", 25 | "button-2": "Gomb 2", 26 | "button-1-label": "Szöveg", 27 | "button-1-url": "url", 28 | "button-2-label": "Szöveg", 29 | "button-2-url": "url", 30 | "del-btn": "Megjelenés törlése", 31 | "file-btn": "Megtekintés fájlban", 32 | "preview-name": "Te", 33 | "preview-playingagame": "JÁTÉKBAN", 34 | "preview-title": "Az applikációd neve", 35 | "base-flyout": "Menj oda az applikációdhoz, és a Kliens ID automatikusan érzékelve lesz! ", 36 | "detected-flyout": "Kliens ID érzékelve, és kimásolva a vágólapra!", 37 | "flush-zNaLgf": "Kattints az 'Új applikáció' gombra, hogy készíthess egy új presence-t, vagy válassz ki egy már meglévőt lent.", 38 | "wordmark-1G98vs": "Discord RPC Fejlesztői Portál", 39 | "aaa-innertext": "Ez lesz a neve a megjelenésednek" 40 | } 41 | -------------------------------------------------------------------------------- /locales/german.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "nonamewastaken", 3 | "language": "Deutsch", 4 | "loading": "Lädt", 5 | "nointernet": "Bitte verbinde dich mit dem Internet um Discord RPC Maker zu nutzen.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Gespeicherte Präsenzen", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Präsenz Name", 10 | "presence-name-placeholder": "Präsenz Name", 11 | "devel": "Entwickler Portal", 12 | "save": "Speichern", 13 | "test": "Präsenz starten", 14 | "client-id": "Client ID", 15 | "client-id-placeholder": "Client ID", 16 | "large-image": "Großes Bild", 17 | "large-image-placeholder": "Großes Bild Name (optional)", 18 | "small-image": "Kleines Bild", 19 | "small-image-placeholder": "Kleines Bild Name (optional, wenn ein großes Bild vorhanden ist)", 20 | "description-1": "Beschreibung", 21 | "description-1-placeholder": "Beschreibung Zeile 1(optional)", 22 | "description-2": "Beschreibung", 23 | "description-2-placeholder": "Beschreibung Zeile 2(optional)", 24 | "button-1": "Knopf 1", 25 | "button-2": "Knopf 2", 26 | "button-1-label": "Beschriftung", 27 | "button-1-url": "url", 28 | "button-2-label": "Beschriftung", 29 | "button-2-url": "url", 30 | "del-btn": "Präsenz löschen", 31 | "file-btn": "In Dateien anzeigen", 32 | "preview-name": "Du", 33 | "preview-playingagame": "SPIELT EIN SPIEL", 34 | "preview-title": "Name deiner App", 35 | "base-flyout": "Gehe zu deiner gewünschten Präsenz, und die Client ID wird automatisch erkannt. ", 36 | "detected-flyout": "Client ID gefunden, in die Zwischenablage kopiert!", 37 | "flush-zNaLgf": "Klicke auf 'New Application' um eine neue Präsenz zu erstellen, oder wähle eine von unten aus.", 38 | "wordmark-1G98vs": "Discord RPC Entwickler Portal", 39 | "aaa-innertext": "So wird deine Präsenz heißen." 40 | } -------------------------------------------------------------------------------- /locales/irish.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "fnionn", 3 | "language": "Gaeilge", 4 | "loading": "Lódáil", 5 | "nointernet": "Ceangail leis an idirlíon le do thoil chun Déantóir RPC Discord a úsáid.", 6 | "title": "Déantóir RPC Discord", 7 | "presence-title": "Láithreachtaí Sábháilte", 8 | "logo": "Déantóir RPC Discord", 9 | "presence-name": "Ainm Láithreacht", 10 | "presence-name-placeholder": "Ainm Láithreachta", 11 | "devel": "Tairseach Forbróra", 12 | "save": "Sábháil", 13 | "test": "Láithreacht Seoladh", 14 | "client-id": "Aitheantas Cliant", 15 | "client-id-placeholder": "Aitheantas Cliaint", 16 | "large-image": "Íomhá Móra", 17 | "large-image-placeholder": "Ainm Íomhá Móra (roghnach)", 18 | "small-image": "Íomhá Beag", 19 | "small-image-placeholder": "Ainm Íomhá Beag (roghnach, ach má tá íomhá mór agat)", 20 | "description-1": "Cur Síos", 21 | "description-1-placeholder": "Cur síos ar líne 1 (roghnach)", 22 | "description-2": "Cur Síos", 23 | "description-2-placeholder": "Cur síos ar líne 2 (roghnach)", 24 | "button-1": "Cnaipe 1", 25 | "button-2": "Cnaipe 2", 26 | "button-1-label": "lipéadaigh", 27 | "button-1-url": "AAA", 28 | "button-2-label": "lipéadaigh", 29 | "button-2-url": "AAA", 30 | "del-btn": "Scrios Láithreacht", 31 | "file-btn": "Taispeáin i gcomhaid", 32 | "preview-name": "Tú", 33 | "preview-playingagame": "Ag Sugradh An ", 34 | "preview-title": "Ainm d’aip", 35 | "base-flyout": "Téigh go dtí an feidhmchlár atá uait, agus braithfear an ID Cliant go huathoibríoch!", 36 | "detected-flyout": "Aitheantas Cliant Braite, cóipeáilte chuig an gearrthaisce!", 37 | "flush-zNaLgf": "Cliceáil 'Feidhmchlár Nua' chun láithreacht nua a chruthú, nó roghnaigh ceann a cruthaíodh cheana thíos", 38 | "wordmark-1G98vs": "Discord RPC Tairseach Réalóir", 39 | "aaa-innertext": "Seo a thabharfar ar do láithreacht." 40 | } -------------------------------------------------------------------------------- /locales/spanish.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Jimmysit0", 3 | "language": "Español", 4 | "loading": "Cargando...", 5 | "nointernet": "Por favor, conectate al internet para usar Discord RPC Maker.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Presencias guardadas", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Nombre de la precencia", 10 | "presence-name-placeholder": "Nombre de la precencia", 11 | "devel": "Portal de desarrolladores", 12 | "save": "Guardar", 13 | "test": "Iniciar la presencia", 14 | "client-id": "ID del cliente", 15 | "client-id-placeholder": "ID del cliente", 16 | "large-image": "Imagen larga", 17 | "large-image-placeholder": "Nombre de la imagen larga (opcional)", 18 | "small-image": "Imagen pequeña", 19 | "small-image-placeholder": "Nombre de la imagen pequeña (opcional, solo si tienes una imagen larga)", 20 | "description-1": "Descripción", 21 | "description-1-placeholder": "Descripción línea uno (opcional)", 22 | "description-2": "Descripción", 23 | "description-2-placeholder": "Descripción línea dos (opcional)", 24 | "button-1": "Botón 1", 25 | "button-2": "Botón 2", 26 | "button-1-label": "Label", 27 | "button-1-url": "url", 28 | "button-2-label": "Label", 29 | "button-2-url": "url", 30 | "del-btn": "Elimina la presencia", 31 | "file-btn": "Mostrar en archivos", 32 | "preview-name": "Tú", 33 | "preview-playingagame": "Jugando un juego", 34 | "preview-title": "El nombre de tu app", 35 | "base-flyout": "Ve a tu aplicación deseada, la ID del cliente será detectada automaticamente! ", 36 | "detected-flyout": "ID del cliente detectada, copiada al portapapeles!", 37 | "flush-zNaLgf": "Clickea 'Nueva aplicación' para crear una presencia nueva, o seleccionar una ya creada debajo", 38 | "wordmark-1G98vs": "Portal de Discord RPC Developer", 39 | "aaa-innertext": "Así es como se llamará tu precencia." 40 | } -------------------------------------------------------------------------------- /locales/french.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "Cypooos", 3 | "language": "Français", 4 | "loading": "Chargement", 5 | "nointernet": "Connecte toi à internet pour utilliser Discord RPC.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Présences sauvegardées", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Nom de la présence", 10 | "presence-name-placeholder": "Nom de la présence", 11 | "devel": "Portail pour Dévellopeur", 12 | "save": "Sauvegarder", 13 | "test": "Démarrer la Présence", 14 | "client-id": "l'ID du Client", 15 | "client-id-placeholder": "l'ID du Client", 16 | "large-image": "Grande Image", 17 | "large-image-placeholder": "Nom de la grande image (optionnel)", 18 | "small-image": "Petite Image", 19 | "small-image-placeholder": "Nom de la petite image (optionnel, seulement si tu as une grande image)", 20 | "description-1": "Description", 21 | "description-1-placeholder": "Description, ligne 1 (optionnel)", 22 | "description-2": "Description", 23 | "description-2-placeholder": "Description, ligne 2 (optionnel)", 24 | "button-1": "Bouton 1", 25 | "button-2": "Bouton 2", 26 | "button-1-label": "Label", 27 | "button-1-url": "url", 28 | "button-2-label": "Label", 29 | "button-2-url": "url", 30 | "del-btn": "Suprimmer la présence", 31 | "file-btn": "Montrer le fichier", 32 | "preview-name": "Toi", 33 | "preview-playingagame": "EN TRAIN DE JOUER", 34 | "preview-title": "Le nom de l'application", 35 | "base-flyout": "Selectionne l'application désirée, et l'ID du Client sera détectée automatiquement! ", 36 | "detected-flyout": "ID du Client détectée, elle a été copié dans ton presse-papier!", 37 | "flush-zNaLgf": "Clique sur 'New Application' pour créé une nouvelle présence, ou séléctionne en une déjà créé.", 38 | "wordmark-1G98vs": "Portail pour Dévellopeur Discord RPC", 39 | "aaa-innertext": "Ce sera le nom de ta présence." 40 | } -------------------------------------------------------------------------------- /locales/russian.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "NightStranger", 3 | "language": "русский", 4 | "loading": "Загрузка", 5 | "nointernet": "Пожалуйста, подключитесь к Интернету для использования Discord RPC Maker.", 6 | "title": "Discord RPC Maker", 7 | "presence-title": "Сохранённые статусы", 8 | "logo": "Discord RPC Maker", 9 | "presence-name": "Название статуса", 10 | "presence-name-placeholder": "Название статуса", 11 | "devel": "Портал разработчиков", 12 | "save": "Сохранить", 13 | "test": "Загрузить статус", 14 | "client-id": "Client ID", 15 | "client-id-placeholder": "Client ID", 16 | "large-image": "Большое изображение", 17 | "large-image-placeholder": "Название большого изображения (опционально)", 18 | "small-image": "Маленькое изображение", 19 | "small-image-placeholder": "Название маленького изображения (опционально, только если есть большое изображение)", 20 | "description-1": "Описание", 21 | "description-1-placeholder": "Описание, строка 1 (опционально)", 22 | "description-2": "Описание", 23 | "description-2-placeholder": "Описание, строка 2 (опционально)", 24 | "button-1": "Кнопка 1", 25 | "button-2": "Кнопка 2", 26 | "button-1-label": "Название", 27 | "button-1-url": "Ссылка", 28 | "button-2-label": "Название", 29 | "button-2-url": "Ссылка", 30 | "del-btn": "Удалить статус", 31 | "file-btn": "Показать в папке", 32 | "preview-name": "Вы", 33 | "preview-playingagame": "ИГРАЕТ В ИГРУ", 34 | "preview-title": "Название вашего приложения", 35 | "base-flyout": "Перейдите в желаемое приложение, и идентификатор клиента будет определен автоматически. ", 36 | "detected-flyout": "Обнаружен идентификатор клиента, скопирован в буфер обмена!", 37 | "flush-zNaLgf": "Нажмите «Новое приложение» чтобы создать новый статус или выберите уже созданный ниже.", 38 | "wordmark-1G98vs": "Портал Разработчиков Discord RPC", 39 | "aaa-innertext": "Так будет называться ваш статус." 40 | } -------------------------------------------------------------------------------- /locales/greek.json: -------------------------------------------------------------------------------- 1 | { 2 | "translate-credits": "TheTaxPerson", 3 | "language": "Ελληνικά", 4 | "loading": "Φόρτωση", 5 | "nointernet": "Συνδεθείτε στο διαδίκτυο για να χρησιμοποιήσετε τον δημιουργό Discord RPC.", 6 | "title": "Δημιουργός Discord RPC", 7 | "presence-title": "Αποθηκευμένες παρουσίες", 8 | "logo": "Δημιουργός Discord RPC", 9 | "presence-name": "Όνομα παρουσίας", 10 | "presence-name-placeholder": "Όνομα παρουσίας", 11 | "devel": "Πύλη προγραμματιστή", 12 | "save": "Αποθήκευση", 13 | "test": "Εκκίνηση παρουσίας", 14 | "client-id": "Ταυτοποίηση Πελάτη", 15 | "client-id-placeholder": "Ταυτοποίηση Πελάτη", 16 | "large-image": "Μεγάλη εικόνα", 17 | "large-image-placeholder": "Όνομα μεγάλης εικόνας (προαιρετικό)", 18 | "small-image": "Μικρή εικόνα", 19 | "small-image-placeholder": "Όνομα μικρής εικόνας (προαιρετικό, μόνο εάν έχετε μεγάλη εικόνα)", 20 | "description-1": "Περιγραφή", 21 | "description-1-placeholder": "Γραμμή περιγραφής 1 (προαιρετικό)", 22 | "description-2": "Περιγραφή", 23 | "description-2-placeholder": "Γραμμή περιγραφής 2 (προαιρετικό)", 24 | "button-1": "Κουμπί 1", 25 | "button-2": "Κουμπί 2", 26 | "button-1-label": "Επιγραφή", 27 | "button-1-url": "Σύνδεσμος", 28 | "button-2-label": "Επιγραφή", 29 | "button-2-url": "Σύνδεσμος", 30 | "del-btn": "Διαγραφή παρουσίας", 31 | "file-btn": "Εμφάνιση στα αρχεία", 32 | "preview-name": "Εσείς", 33 | "preview-playingagame": "ΠΑΙΖΕΙ ΕΝΑ ΠΑΙΧΝΙΔΙ", 34 | "preview-title": "Το όνομα της εφαρμογής σας", 35 | "base-flyout": "Μεταβείτε στην εφαρμογή που θέλετε και το Client ID θα εντοπιστεί αυτόματα!", 36 | "detected-flyout": "Εντοπίστηκε το Client ID, αντιγραφή στο πρόχειρο!", 37 | "flush-zNaLgf": "Κάντε κλικ στην επιλογή 'New Application' για να δημιουργήσετε μια νέα παρουσία ή επιλέξτε μια ήδη δημιουργημένη παρακάτω", 38 | "wordmark-1G98vs": "Πύλη προγραμματιστή Discord RPC", 39 | "aaa-innertext": "Αυτό θα ονομάζεται η παρουσία σας. " 40 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | .vscode 10 | 11 | # Builds 12 | out/ 13 | dist/ 14 | 15 | # Diagnostic reports (https://nodejs.org/api/report.html) 16 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 17 | 18 | # Runtime data 19 | pids 20 | *.pid 21 | *.seed 22 | *.pid.lock 23 | 24 | # Directory for instrumented libs generated by jscoverage/JSCover 25 | lib-cov 26 | 27 | # Coverage directory used by tools like istanbul 28 | coverage 29 | *.lcov 30 | 31 | # nyc test coverage 32 | .nyc_output 33 | 34 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 35 | .grunt 36 | 37 | # Bower dependency directory (https://bower.io/) 38 | bower_components 39 | 40 | # node-waf configuration 41 | .lock-wscript 42 | 43 | # Compiled binary addons (https://nodejs.org/api/addons.html) 44 | build/Release 45 | 46 | # Dependency directories 47 | node_modules/ 48 | jspm_packages/ 49 | 50 | # TypeScript v1 declaration files 51 | typings/ 52 | 53 | # TypeScript cache 54 | *.tsbuildinfo 55 | 56 | # Optional npm cache directory 57 | .npm 58 | 59 | # Optional eslint cache 60 | .eslintcache 61 | 62 | # Microbundle cache 63 | .rpt2_cache/ 64 | .rts2_cache_cjs/ 65 | .rts2_cache_es/ 66 | .rts2_cache_umd/ 67 | 68 | # Optional REPL history 69 | .node_repl_history 70 | 71 | # Output of 'npm pack' 72 | *.tgz 73 | 74 | # Yarn Integrity file 75 | .yarn-integrity 76 | 77 | # dotenv environment variables file 78 | .env 79 | .env.test 80 | 81 | # parcel-bundler cache (https://parceljs.org/) 82 | .cache 83 | 84 | # Next.js build output 85 | .next 86 | 87 | # Nuxt.js build / generate output 88 | .nuxt 89 | 90 | # Gatsby files 91 | .cache/ 92 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 93 | # https://nextjs.org/blog/next-9-1#public-directory-support 94 | # public 95 | 96 | # vuepress build output 97 | .vuepress/dist 98 | 99 | # Serverless directories 100 | .serverless/ 101 | 102 | # FuseBox cache 103 | .fusebox/ 104 | 105 | # DynamoDB Local files 106 | .dynamodb/ 107 | 108 | # TernJS port file 109 | .tern-port 110 | 111 | # Options 112 | options.json 113 | .vscode/settings.json 114 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [ main ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ main ] 20 | schedule: 21 | - cron: '36 6 * * 5' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | 28 | strategy: 29 | fail-fast: false 30 | matrix: 31 | language: [ 'javascript' ] 32 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] 33 | # Learn more: 34 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v2 39 | 40 | # Initializes the CodeQL tools for scanning. 41 | - name: Initialize CodeQL 42 | uses: github/codeql-action/init@v1 43 | with: 44 | languages: ${{ matrix.language }} 45 | # If you wish to specify custom queries, you can do so here or in a config file. 46 | # By default, queries listed here will override any specified in a config file. 47 | # Prefix the list here with "+" to use these queries and those in the config file. 48 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 49 | 50 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 51 | # If this step fails, then you should remove it and run the build manually (see below) 52 | - name: Autobuild 53 | uses: github/codeql-action/autobuild@v1 54 | 55 | # ℹ️ Command-line programs to run using the OS shell. 56 | # 📚 https://git.io/JvXDl 57 | 58 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 59 | # and modify them (or add more) to build your code if your project 60 | # uses a compiled language 61 | 62 | #- run: | 63 | # make bootstrap 64 | # make release 65 | 66 | - name: Perform CodeQL Analysis 67 | uses: github/codeql-action/analyze@v1 68 | -------------------------------------------------------------------------------- /loading.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 96 | 97 | 98 | 99 |
100 |

Loading

101 |
102 |
103 |
104 |
105 | 108 |
109 | 110 | 111 | -------------------------------------------------------------------------------- /style/matter.css: -------------------------------------------------------------------------------- 1 | /* Switch */ 2 | .matter-switch { 3 | --matter-helper-theme: var(--matter-theme-rgb, var(--matter-primary-rgb, 33, 150, 243)); 4 | z-index: 0; 5 | position: relative; 6 | display: inline-block; 7 | color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.87); 8 | font-family: var(--matter-font-family, "Roboto", "Segoe UI", BlinkMacSystemFont, system-ui, -apple-system); 9 | font-size: 16px; 10 | line-height: 1.5; 11 | } 12 | 13 | /* Track */ 14 | .matter-switch>input { 15 | appearance: none; 16 | -moz-appearance: none; 17 | -webkit-appearance: none; 18 | z-index: 1; 19 | position: relative; 20 | display: inline-block; 21 | margin: 0 0 0 5px; 22 | border: solid 5px transparent; 23 | border-radius: 12px; 24 | width: 46px; 25 | height: 24px; 26 | background-clip: padding-box; 27 | background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38); 28 | outline: none; 29 | cursor: pointer; 30 | transition: background-color 0.2s, opacity 0.2s; 31 | } 32 | 33 | /* Span */ 34 | .matter-switch>input+span { 35 | display: inline-block; 36 | box-sizing: border-box; 37 | margin-right: -51px; 38 | padding-right: 51px; 39 | width: inherit; 40 | cursor: pointer; 41 | } 42 | 43 | /* Highlight */ 44 | .matter-switch>input+span::before { 45 | content: ""; 46 | position: absolute; 47 | right: 11px; 48 | top: -8px; 49 | display: block; 50 | border-radius: 50%; 51 | width: 40px; 52 | height: 40px; 53 | background-color: rgb(var(--matter-onsurface-rgb, 0, 0, 0)); 54 | opacity: 0; 55 | transform: scale(1); 56 | pointer-events: none; 57 | transition: opacity 0.3s 0.1s, transform 0.2s 0.1s; 58 | } 59 | 60 | /* Thumb */ 61 | .matter-switch>input+span::after { 62 | content: ""; 63 | z-index: 1; 64 | position: absolute; 65 | top: 2px; 66 | right: 21px; 67 | border-radius: 50%; 68 | width: 20px; 69 | height: 20px; 70 | background-color: rgb(var(--matter-surface-rgb, 255, 255, 255)); 71 | box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12); 72 | pointer-events: none; 73 | transition: background-color 0.2s, transform 0.2s; 74 | } 75 | 76 | /* Checked */ 77 | .matter-switch>input:checked { 78 | background-color: rgba(var(--matter-helper-theme), 0.6); 79 | } 80 | 81 | .matter-switch>input:checked+span::before { 82 | right: -5px; 83 | background-color: rgb(var(--matter-helper-theme)); 84 | } 85 | 86 | .matter-switch>input:checked+span::after { 87 | background-color: rgb(var(--matter-helper-theme)); 88 | transform: translateX(16px); 89 | } 90 | 91 | /* Hover, Focus */ 92 | .matter-switch:hover>input+span::before { 93 | opacity: 0.04; 94 | } 95 | 96 | .matter-switch>input:focus+span::before { 97 | opacity: 0.12; 98 | } 99 | 100 | .matter-switch:hover>input:focus+span::before { 101 | opacity: 0.16; 102 | } 103 | 104 | /* Active */ 105 | .matter-switch:active>input { 106 | background-color: rgba(var(--matter-helper-theme), 0.6); 107 | } 108 | 109 | .matter-switch:active>input:checked { 110 | background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38); 111 | } 112 | 113 | .matter-switch:active>input+span::before { 114 | opacity: 1; 115 | transform: scale(0); 116 | transition: transform 0s, opacity 0s; 117 | } 118 | 119 | /* Disabled */ 120 | .matter-switch>input:disabled { 121 | background-color: rgba(var(--matter-onsurface-rgb, 0, 0, 0), 0.38); 122 | opacity: 0.38; 123 | cursor: default; 124 | } 125 | 126 | .matter-switch>input:checked:disabled { 127 | background-color: rgba(var(--matter-helper-theme), 0.6); 128 | } 129 | 130 | .matter-switch>input:disabled+span { 131 | color: rgba(var(--matter-onsurface-rgb, 0, 0, 0, 0.38)); 132 | cursor: default; 133 | } 134 | 135 | .matter-switch>input:disabled+span::before { 136 | z-index: 1; 137 | margin: 10px; 138 | width: 20px; 139 | height: 20px; 140 | background-color: rgb(var(--matter-surface-rgb, 255, 255, 255)); 141 | transform: scale(1); 142 | opacity: 1; 143 | transition: none; 144 | } 145 | 146 | .matter-switch>input:disabled+span::after { 147 | opacity: 0.38; 148 | } -------------------------------------------------------------------------------- /locales/faq/russian.html: -------------------------------------------------------------------------------- 1 |

🔽 Прочитайте инструкцию полностью! 🔽

2 |

Шаг 1

3 | 11 |

Шаг 2

12 | 36 |

Скриншот

37 | 38 |

Кастомные темы

39 |

Если вы заметили, в настройках (иконка шестерëнки снизу справа) последняя опция для тем это "Кастомная". Чтобы 40 | создать кастомную тему: 41 |

42 |
    43 |
  1. Вернитесь на главный экран.
  2. 44 |
  3. Нажмите кнопку "Показать в папке".
  4. 45 |
  5. Отредактируйте и сохраните файл custom.css. Редактирование цветов в 6-значном hex формате. Продвинутое 46 | редактирование требует углублëнного знания CSS.
  6. 47 |
  7. Выберите "Кастомная" внизу списка тем.
  8. 48 |
49 | 50 |

Решение проблем

51 |

Помогите, пробежался быстро по инструкции и ничего не понял!

52 |

В начале инструкции было предупреждение насчёт этого. Вернитесь к началу и проделайте всë шаг за шагом ВНИМАТЕЛЬНО. 53 |

54 |

Кнопки в статусе не работают!

55 |

Discord не позволяет нажимать на свои кнопки. Однако, все остальные могут это делать. Это лимит самого Discord.

56 |

Статус не отображается!

57 |

Убедитесь, что вы не невидимый/оффлайн. Если статус онлайн/не активен/не беспокоить...

58 | 66 |

Картинки не отображаются!

67 |

Если вы только что их загрузили, дискорду нужна примерно минута для их кэширования.

68 | 69 |

Титры

70 |

Разработчики

71 | 75 |

Используемые компоненты

76 | 82 |

Донатеры

83 | 88 |

Переводчики

89 | 105 |

Помощники Discord

106 | 114 |

Лицензия

115 |

Вампус и используемые гифки Вампуса были задизайнены и разработаны Discord inc. Эта программа официально не связана с 116 | Discord inc.

117 |


-------------------------------------------------------------------------------- /locales/faq/french.html: -------------------------------------------------------------------------------- 1 |

🔽 Fait bien attention de tout lire ! 🔽

2 |

Première étape

3 | 11 |

Deuxième étape

12 | 35 |

Schéma

36 | 37 |

Thèmes Personnalisé

38 |

Dans les paramètres (l'icone d'engrenage en bas à droite), la dernière option est "Custom". Pour faire un thème 39 | personnalisé: 40 |

41 |
    42 |
  1. Retourner sur l'écran principal
  2. 43 |
  3. Clique sur le bouton "Montrer le fichier"
  4. 44 |
  5. Vous pouvez éditer et modifier le fichier custom.css. Les couleurs sont sauvegardée en hexadécimal à 6 45 | charactères. De l'édition 46 | plus poussé nécéssite des connaissances basique en CSS.
  6. 47 |
  7. Selectionner l'option Custom en bas de la liste.
  8. 48 |
49 | 50 |

Problèmes occurents

51 |

Aidez-moi, je suis confu et j'ai suivi les instructions `run from source` !

52 |

Il y avait un avertissement à cet endroit pour une raison. Reviens en arrière et lis les instructions d'installation 53 | normale, potat.

54 |

Mes boutons ne marchent pas !

55 |

Discord ne te permet pas de cliquer sur tes propres boutons. Par contre, tout le monde peut. C'est une limitation 56 | avec Discord.

57 |

Je ne peux pas voir ma présence !

58 |

Vérifie que tu n'es pas invisible/déconnecté. Et sinon...

59 | 68 |

Les images ne s'affichent pas !

69 |

Si tu viens de les rajouter, parfois Discord prend un peu de temps avant de les ajouter proprement.

70 | 71 |

Credits

72 |

Dévellopeurs

73 | 77 |

Composants utillisés

78 | 84 |

Donateurs

85 | 90 |

Traducteurs

91 | 103 |

Assistants Discord

104 | 112 |

Copyright credits

113 |

Le Wumpus et les gifs de Wumpus utillisés ont été créé et appartiennent à Discord inc. Cette application n'est pas 114 | affilié 115 | avec 116 | Discord inc.

117 |


-------------------------------------------------------------------------------- /locales/faq/polish.html: -------------------------------------------------------------------------------- 1 |

🔽 Pamiętaj, aby przeczytać wszystkie informacje poniżej! 🔽

2 |

Krok 1

3 | 11 |

Krok 2

12 | 35 |

Diagram

36 | 37 |

Niestandardowe motywy

38 |

Jeśli zauważysz w ustawieniach (ikona koła zębatego w prawym dolnym rogu), ostatnią opcją dla motywów jest 39 | „Niestandardowe”. Aby utworzyć motyw niestandardowy: 40 |

41 |
    42 |
  1. Wróć do ekranu głównego
  2. 43 |
  3. Kliknij przycisk „Pokaż w plikach”
  4. 44 |
  5. Edytuj i zapisz plik custom.css. Kolory są w 6-literowym formacie szesnastkowym. Bardziej zaawansowana edycja 45 | wymaga podstawowej wiedzy o CSS.
  6. 46 |
  7. Wybierz opcję Niestandardowy u dołu listy motywów.
  8. 47 |
48 | 49 |

Powszechne problemy

50 |

Pomocy, jestem zdezorientowany i postępowałem zgodnie z instrukcjami uruchamiania!

51 |

Nie bez powodu było tam duże ostrzeżenie. Wróć i przeczytaj zwykłe instrukcje instalacji.

52 |

Moje przyciski nie działają!

53 |

Discord nie pozwala na klikanie własnych przycisków. Jednak wszyscy inni mogą. To jest ograniczenie w Discord.

54 |

Nie widzę mojego szablonu!

55 |

Upewnij się, że nie jesteś niewidoczny / offline. Działa gdy twój status to online / zaraz wracam / nie przeszkadzać 56 |

57 | 65 |

Obraz(y) nie są wyświetlane!

66 |

Jeśli po prostu je umieścisz, czasami Discord'owi zajmuje około minuty, aby je prawidłowo buforować.

67 | 68 |

Autorzy

69 |

Deweloperzy

70 | 74 |

Zastosowane komponenty

75 | 81 |

Donatorzy

82 | 87 |

Tłumacze

88 | 104 |

Pomocnicy Discorda

105 | 113 |

Prawa autorskie

114 |

Użyte gify Wumpus i obrazy Wumpus zostały zaprojektowane i są własnością Discord inc. Ta aplikacja nie jest 115 | oficjalnie powiązana z Discord inc.

117 |


-------------------------------------------------------------------------------- /locales/faq/german.html: -------------------------------------------------------------------------------- 1 |

🔽 Bitte lies dir alles gründlich durch! 🔽

2 |

Schritt 1

3 | 11 |

Schritt 2

12 | 35 |

Diagramm

36 | 37 |

Benutzerdefinierte Designs

38 |

Falls es dir in den Einstellungen (Zahnrad Icon unten rechts) noch nicht aufgefallen ist, die Letzte Design-Option 39 | ist "Benutzerdefiniert". Um ein Benutzerdefiniertes Design zu erstellen: 40 |

41 |
    42 |
  1. Gehe zum Hauptmenü zurück.
  2. 43 |
  3. Klick auf den "In Dateien anzeigen" Knopf
  4. 44 |
  5. Bearbeite und speicher die custom.css Datei. Die Farben sind in dem 6-Buchstaben hex Format. Fortgeschrittenere 45 | Änderungen benötigen grundlegende css Kenntnisse.
  6. 46 |
  7. Wähle custom aus der Design liste aus.
  8. 47 |
48 | 49 |

Häufige Probleme

50 |

Hilfe, ich bin verwirrt und habe den "run from source" Anleitungen gefolgt!

51 |

Die große Warnung dort hat einen Grund. Probier die normalen installations Anweisungen.

52 |

Meine Knöpfe funktionieren nicht!

53 |

Discord lässt dich nicht deine eigenen knöpfe anklicken, jeder andere kann dies! Dieses Problem liegt an Discord.

54 |

Ich kann meine Präsenz nicht sehen!

55 |

Gehe sicher, dass dein Status nicht auf offline/unsichtbar gestellt ist. Falls du nicht offline/unsichtbar bist... 56 |

57 | 66 |

Die Bilder/das Bild werden/wird nicht angezeigt!

67 |

Wenn du sie erst vor kurzem eingefügt hast Braucht Discord manchmal ein paar Minuten um diese richtig zu cachen.

68 | 69 |

Credits

70 |

Entwickler

71 | 75 |

Genutzte Komponenten

76 | 82 |

Spender

83 | 88 |

Übersetzer

89 | 105 |

Discord Helfer

106 | 114 |

Copyright credits

115 |

Wumpus und die genutzten Wumpus gifs wurden von Discord inc. designt und sind ihr Besitz. Dieses Programm ist nicht 116 | offiziell mit 117 | Discord inc. verbunden. 118 |

119 |


-------------------------------------------------------------------------------- /locales/faq/hungarian.html: -------------------------------------------------------------------------------- 1 |

🔽 Kérlek olvasd el az egészet, az elejétől a végéig! 🔽

2 |

Első lépés

3 | 11 |

Második lépés

12 | 36 |

Diagram

37 | 38 |

Saját téma készítés

39 |

Amennyiben észrevetted, hogy a beállításokban (jobb fenti csapágy ikon), az utolsó opció a témákhoz az, hogy "Saját". 40 | Így tudsz csinálni saját témát: 41 |

42 |
    43 |
  1. Menj vissza a főképernyőre
  2. 44 |
  3. Kattints rá a "Fájlok mutatása könyvtárban" gombra
  4. 45 |
  5. Változtatsd meg, majd menjts el a custom.css file-t. A színek legyenek 6 karakteres, hex formátumban. Ha jobban 46 | szeretnél foglalkozni ezzel, ahhoz szükséges alap CSS tudás.
  6. 47 |
  7. Select Custom from the bottom of the theme list.
  8. 48 |
49 | 50 |

Gyakori problémák

51 |

Segítség, zavarodott vagyok, és követtem mindent a forrás utasításai alapján!

52 |

There was a big warning there for a reason. Go back and read the regular install instructions, ya goober.

53 |

Nem működnek a gombjaim!

54 |

A Discord nem engedi, hogy a saját gombjaidra kattints. Viszont, mások rátudnak kattintani. Ez egy Discordon belüli 55 | limitáció.

56 |

Nem látom a megjelenést!

57 |

ellenőrizd le, hogy nem vagy-e offline/láthatatlan módban. Amennyiben online/alvó/ne zavarj módban vagy...

58 | 66 |

A kép(ek) nem jelenik/jelennek meg!

67 |

Ha csak behúzod, a Discordnak néha időre lesz szüksége (akár percekre), hogy eltárolja őket.

68 | 69 |

Kreditek

70 |

Fejlesztők

71 | 75 |

Felhasznált komponensek

76 | 82 |

Támogatók

83 | 90 |

Fordítók

91 | 107 |

Discord segítők

108 | 116 |

Copyright credits

117 |

Wumpus és a Wumpus gifek a Discord inc. által lettel készítve, és ők is ennek tulajdonosai. A programnak semmilyen 118 | hivatalos köze nincs a Discord-hoz.

120 |


121 | -------------------------------------------------------------------------------- /locales/faq/english.html: -------------------------------------------------------------------------------- 1 |

🔽 Make sure to read all the way down! 🔽

2 |

Step 1

3 | 11 |

Step 2

12 | 34 |

Diagram

35 | 36 |

Custom theming

37 |

If you notice in settings (bottom right gear icon), the last option for themes is "Custom". To make a custom theme: 38 |

39 |
    40 |
  1. Go back to the main screen
  2. 41 |
  3. Click the "Show in files" button
  4. 42 |
  5. Edit and save the custom.css file. The colors are in the 6-letter hex format. More advanced editing requires 43 | basic CSS knowledge.
  6. 44 |
  7. Select Custom from the bottom of the theme list.
  8. 45 |
46 | 47 |

CLI Instructions

48 |

For users that know what they're doing, you can run 49 | discordrpcmaker <file> in the terminal, where 50 | file is the file name of the presence you want to launch, which can be found under each presence name 51 | on the sidebar.

52 | 53 |

Common issues

54 |

Help, I'm confused and followed the run from source instructions!

55 |

There was a big warning there for a reason. Go back and read the regular install instructions, ya goober.

56 |

My buttons aren't working!

57 |

Discord doesn't let you click your own buttons. However, everyone else can. This is a limitation with Discord.

58 |

I can't see the presence!

59 |

Make sure you are not invisible/offline. If you ARE online/idle/dnd...

60 | 67 |

The image(s) aren't showing!

68 |

If you just put them in, sometimes Discord takes a minute or so to cache them properly.

69 | 70 |

Credits

71 |

Developers

72 | 76 |

Components used

77 | 83 |

Donators

84 | 92 |

Translators

93 | 109 |

Discord helpers

110 | 118 |

Art

119 | 124 | 126 |

Copyright notice

127 |

This application is licensed under the GPL-3 license.

128 |

Wumpus and the Wumpus gifs used are designed and owned by Discord inc. This application is not officially affiliated 129 | with 130 | Discord inc.

131 |


-------------------------------------------------------------------------------- /clientidDetect.js: -------------------------------------------------------------------------------- 1 | const electron = require('electron') 2 | const copy = require('copy-to-clipboard') 3 | var firstFlyout = false 4 | 5 | document.addEventListener("DOMContentLoaded", () => { 6 | newflyout() 7 | addStyle(` 8 | .wrapper-3aJbIC, 9 | [href="/developers/teams"], 10 | [href="/developers/servers"], 11 | [href="/developers/docs"], 12 | [href*="oauth2"], 13 | [href*="visualizer"], 14 | [href*="bot"], 15 | [href*="whitelist"], 16 | .flex-1xMQg5.flexHorizontal-1YWL8b.flexJustifyStart-1R2n-N.flexAlignStretch-1aueRm.flexWrap-1K8nA-:nth-child(4), 17 | .flex-1xMQg5.flexHorizontal-1YWL8b.flexJustifyStart-1R2n-N.flexAlignStretch-1aueRm.flexWrap-1K8nA-:nth-child(5) { 18 | display: none !important; 19 | position: absolute !important; 20 | top: -999px !important; 21 | left: -999px !important; 22 | z-index: 0 !important; 23 | visibility: hidden !important; 24 | width: 0px !important; 25 | height: 0px !important; 26 | } 27 | .wrapper-36iaZw { 28 | flex: 0 0 250px !important; 29 | } 30 | `); 31 | const targetNode = document.body; 32 | 33 | // Options for the observer (which mutations to observe) 34 | let config = { characterData: false, attributes: false, childList: true, subtree: true }; 35 | 36 | // Create an observer instance linked to the callback function 37 | const observer = new MutationObserver(callback); 38 | 39 | // Start observing the target node for configured mutations 40 | observer.observe(targetNode, config); 41 | 42 | }) 43 | 44 | document.addEventListener("click", () => { 45 | callback() 46 | }) 47 | 48 | const callback = function (mutationsList) { 49 | console.log("change") 50 | 51 | let prevflyout = document.querySelector("#drpcm-hint-flyout") 52 | if (prevflyout == null && firstFlyout == false) { 53 | try { 54 | setTimeout(newflyout, 2000) 55 | firstFlyout = true 56 | } catch (e) { 57 | //firstFlyout = false 58 | } 59 | } 60 | try { 61 | /*if (window.location.href == "https://discord.com/developers/applications") {*/ 62 | setTimeout(acuallyEndPoorElements, 2000) 63 | setTimeout(modifyText, 2000) 64 | /*} else {*/ 65 | //acuallyEndPoorElements() 66 | //modifyText() 67 | /*}*/ 68 | 69 | } catch (e) { } 70 | setTimeout(() => { 71 | let prevflyout = document.querySelector("#drpcm-hint-flyout") 72 | let clientid = document.querySelector(".code-j7WzRK") 73 | let fly = document.querySelector("#drpcm-success-flyout") 74 | if (clientid !== null && fly == null) { 75 | console.log("detected clientid") 76 | let id = clientid.innerText 77 | if (prevflyout !== null) { prevflyout.remove() } 78 | makeflyout(` 79 | Detected Client ID, copied to clipboard! 80 | ${id} 81 | `, "drpcm-success-flyout") 82 | copy(id) 83 | setTimeout(() => {document.querySelector("#drpcm-success-flyout").remove()}, "10000") 84 | document.querySelector(".backToLink-UqPo19").addEventListener("click", () => { 85 | console.log("back") 86 | firstFlyout = false 87 | document.querySelector("#drpcm-success-flyout").remove() 88 | }) 89 | } 90 | document.querySelector(".alert-2Ffs8r.warning-2eRcFb").innerHTML = `Uploading/deleting can sometimes take 1-2 minutes depending on Discord's servers. After uploading an image, you cannot change its name.` 91 | }, 500) 92 | 93 | 94 | }; 95 | 96 | function newflyout() { 97 | let prevflyout = document.querySelector("#drpcm-hint-flyout") 98 | if (prevflyout !== null) { prevflyout.remove() } 99 | if (window.location.href == "https://discord.com/developers/applications") { 100 | makeflyout("Go to your desired application, and the Client ID will be detected automatically! ", "drpcm-hint-flyout") 101 | } 102 | } 103 | 104 | function makeflyout(html, id) { 105 | let flyout = document.createElement("div") 106 | flyout.id = id 107 | flyout.innerHTML = html + `` 108 | flyout.style.position = "absolute" 109 | flyout.style.zIndex = "999" 110 | flyout.style.bottom = "0" 111 | flyout.style.right = "0" 112 | flyout.style.margin = "1rem" 113 | flyout.style.background = "#202225" 114 | flyout.style.borderRadius = "5px" 115 | flyout.style.padding = "1rem" 116 | document.body.appendChild(flyout) 117 | } 118 | 119 | function modifyText() { 120 | if (document.querySelector(".flush-zNaLgf") !== null && document.querySelector(".wordmark-1G98vs").innerText != "Discord RPC Developer Portal") { 121 | document.querySelector(".flush-zNaLgf").innerText = "Click 'New Application' to create a new presence, or select an already created one below" 122 | document.querySelector(".wordmark-1G98vs").innerText = "Discord RPC Developer Portal" 123 | let clientid = document.querySelector(".code-j7WzRK") 124 | document.querySelector(".button-38aScr").addEventListener("click", () => { 125 | let aaa = document.getElementsByClassName('medium-zmzTW- weightNormal-3CX1dN') 126 | aaa[0].innerText = "This is what your presence will be called." 127 | }) 128 | 129 | } 130 | } 131 | 132 | function acuallyEndPoorElements() { 133 | if (window.location.href.includes("rich-presence/assets") && document.querySelectorAll(".marginBottomMedium-3rCQQt").length > 2) { 134 | document.querySelectorAll(".marginBottomMedium-3rCQQt")[1].remove() 135 | document.querySelectorAll(".marginBottomMedium-3rCQQt")[0].remove() 136 | } 137 | } 138 | function addStyle(styleString) { 139 | const style = document.createElement('style'); 140 | style.textContent = styleString; 141 | document.head.append(style); 142 | } -------------------------------------------------------------------------------- /locales/faq/latvian.html: -------------------------------------------------------------------------------- 1 |

🔽 Noteikti izlasiet visu ceļu līdz galam! 🔽

2 |

1. solis

3 | 11 |

2. solis

12 | 34 |

Diagramma

35 | 36 |

Pielāgota tematika

37 |

Ja pamanāt iestatījumos (apakšējā labajā pusē esošā zobrata ikona), pēdējā motīvu opcija ir "Custom". Lai izveidotu pielāgotu motīvu: 38 |

39 |
    40 |
  1. Atgriezieties galvenajā ekrānā
  2. 41 |
  3. Noklikšķiniet uz pogas "Rādīt failos"
  4. 42 |
  5. Rediģējiet un saglabājiet failu custom.css. Krāsas ir sešu burtu hex formātā. Nepieciešama uzlabota rediģēšana 43 | vajadzīgas CSS pamatzināšanas.
  6. 44 |
  7. Motīvu saraksta apakšdaļā atlasiet Custom.
  8. 45 |
46 | 47 |

CLI Instrukcijas

48 |

Varat palaist lietotājiem, kuri zina, ko viņi dara discordrpcmaker <faila> terminālā, kur faila ir tās klātbūtnes faila nosaukums, kuru vēlaties sākt, kas atrodams zem katra sānjoslas klātbūtnes nosaukuma.

49 | 50 |

Kopīgi jautājumi

51 |

Palīdziet, es esmu neizpratnē un sekoju līdzi avota instrukcijām!

52 |

Ne velti tur bija liels brīdinājums. Atgriezieties un izlasiet parastās instalēšanas instrukcijas.

53 |

Manas pogas nedarbojas!

54 |

Nesaskaņas neļauj jums noklikšķināt uz savām pogām. Tomēr visi pārējie to var. Tas ir ierobežojums attiecībā uz Discord.

55 |

Es neredzu klātbūtni!

56 |

Pārliecinieties, ka neesat redzams/bezsaistē. Ja esat tiešsaistē/dīkstāvē/dnd...

57 | 64 |

Attēls (-i) netiek rādīti (-i)!

65 |

Ja jūs tos vienkārši ievietojat, dažreiz Discord prasa apmēram minūti, lai tos pareizi saglabātu kešatmiņā.

66 | 67 |

Kredīti

68 |

Izstrādātāji

69 | 73 |

Izmantotie komponenti

74 | 80 |

Ziedotāji

81 | 89 |

Tulkotāji

90 | 106 |

Discorda palīgi

107 | 115 |

Māksla

116 | 121 | 123 |

CPaziņojums par autortiesībām

124 |

Šī lietojumprogramma ir licencēta saskaņā ar GPL-3 licenci.

125 |

Wumpus un izmantotie Wumpus gifi ir izstrādāti un pieder Discord inc. Šis pieteikums nav oficiāli saistīts 126 | ar 127 | Discord inc.

128 |


-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Logo](https://cdn.discordapp.com/attachments/802218008574820393/803422081105526804/image3.png)](https://drpcm.t1c.dev/) 2 | ## ⬇️ Scroll down for install instructions! ⬇️ 3 | 4 | [![Discord](https://discordapp.com/api/guilds/716364441658327120/embed.png?style=shield)](https://discord.gg/Z7UZPR3bbW) 5 | [![Github](https://img.shields.io/badge/star_it_on-github-black?style=shield&logo=github)](https://github.com/thatonecalculator/discordrpcmaker) 6 | [![BMC](https://img.shields.io/badge/buy_me_a-coffee-FFDD00?style=shield&logo=paypal)](https://buymeacoffee.com/that1calculator) 7 | [![NPM](https://img.shields.io/badge/on-npm-CF1212.svg?style=flat&logo=npm)](https://www.npmjs.com/discordrpcmaker) 8 | 9 | ![Promo](https://cdn.discordapp.com/attachments/810799100940255260/838968321516503111/ad200kb.jpg) 10 | ![Large](https://media.discordapp.net/attachments/810799100940255260/838485035506073630/unknown.png) 11 | ![Small](https://media.discordapp.net/attachments/810799100940255260/838485901520797776/unknown.png) 12 | 13 | [![Discord](https://discordapp.com/api/guilds/716364441658327120/embed.png?style=banner2)](https://discord.gg/Z7UZPR3bbW) 14 | 15 | ## Features 16 | 17 | - [x] Clickable buttons! 18 | - [x] Make and manage multiple presences 19 | - [x] Clean and lightweight UI 20 | - [x] Clear instructions 21 | - [x] Optional timer 22 | - [x] Custom, simplified developer portal 23 | - [x] Easy installers for Windows, macOS, and Linux 24 | - [x] Export presences and share with friends 25 | - [x] Multiple themes 26 | - [x] Cross-platform system tray support 27 | - [x] Auto-update 28 | - [x] Pywal support 29 | - [x] AUR Package 30 | - [x] CLI support 31 | - [ ] Code signing on Windows (soon) 32 | - [ ] Translations (soon) 33 | - [ ] Hotkeys (soon) 34 | - [ ] Online sharing (future) 35 | 36 | --- 37 | 38 | ## Install 39 | ###### Version 2.0.9 40 | 41 | #### [Windows ![windows](https://media.discordapp.net/attachments/810799100940255260/838488668816932965/ezgif-6-ac9683508192.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-windows.exe) 42 | 43 | - Download the exe, click More Info > Run Anyway > Open Discord RPC Maker from the desktop shortcut or start menu 44 | 45 | --- 46 | 47 | #### [macOS ![mac](https://media.discordapp.net/attachments/810799100940255260/838489488505307176/ezgif-6-cea52c6e0dcc.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-macos.dmg) 48 | 49 | - Download & mount the dmg, drag Discord RPC Maker into the Applications folder > Double click on Applications folder > Right click Discord RPC Maker > Open > Open 50 | 51 | --- 52 | 53 | #### [AppImage (all Linux distros) ![tux](https://media.discordapp.net/attachments/810799100940255260/838491112863039558/ezgif-6-17b58fff7c7c.png) ![ai](https://media.discordapp.net/attachments/810799100940255260/838490721232355398/ezgif-6-35f6005300eb.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-linux.appimage) 54 | 55 | - Download and run. Easy! 56 | 57 | #### [AUR package (discordrpcmaker)](https://aur.archlinux.org/packages/discordrpcmaker/) ![arch](https://media.discordapp.net/attachments/810799100940255260/838491685892784178/ezgif-6-fd025aa8c722.png) 58 | 59 | - `yay -S discordrpcmaker` (replace `yay` with your AUR helper of choice) 60 | 61 | #### [.deb (Ubuntu/Debian based Linux distros) ![ubun](https://media.discordapp.net/attachments/810799100940255260/838490150610796544/ezgif-6-0bcaf2484f82.png) ![deb](https://media.discordapp.net/attachments/810799100940255260/838489897975021609/ezgif-6-6c941861dbcc.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-linux.deb) 62 | 63 | - Download, `sudo apt install /path/to/discordrpcmaker-linux.deb` or open with GDebi/Eddy. 64 | 65 | #### [.rpm (RPM based Linux distros) ![fedora](https://media.discordapp.net/attachments/810799100940255260/838492071698104320/ezgif-6-e99994d2403a.png) ![suse](https://media.discordapp.net/attachments/810799100940255260/838492513152270377/ezgif-6-179f42e57f24.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-linux.rpm) 66 | 67 | - Download, `sudo rpm -i /path/to/discordrpcmaker-linux.rpm` 68 | 69 | #### [Tarball (all Linux distros) ![tux](https://media.discordapp.net/attachments/810799100940255260/838491112863039558/ezgif-6-17b58fff7c7c.png)](https://github.com/ThatOneCalculator/DiscordRPCMaker/releases/download/v2.0.9/discordrpcmaker-linux.tar.gz) 70 | 71 | - Download, `tar -xvf /path/to/discordrpcmaker-linux.tar.gz` > Run: `discordrpcmaker-2.0.9/discordrpcmaker`; To install, `mv ./discordrpcmaker-2.0.9 /bin/drpcm && ln -s /bin/drpcm/discordrpcmaker /bin/discordrpcmaker`, and run `discordrpcmaker`. 72 | 73 | --- 74 | 75 | #### From source ![electron](https://media.discordapp.net/attachments/810799100940255260/838533828384391208/ezgif-2-828b221b651a.png) 76 | ###### ⚠ Don't do this unless you intend to modify the code! 77 | - Install NodeJS/NPM, Yarn, & Electron 78 | - `git clone https://github.com/thatonecalculator/discordrpcmaker && cd discordrpcmaker && yarn install && npm run start` 79 | 80 | --- 81 | 82 | ## Supporters 83 | You can [![BuyMeACoffee](https://img.shields.io/badge/buy_me_a-coffee-FFDD00?style=shield&logo=paypal)](https://buymeacoffee.com/that1calculator) to get your name here! 84 | 85 | We're trying to raise $150 to pay for online services for the next update and code signing! 86 | 87 | - [**JusticeServ**](https://github.com/justiceserv) 88 | - [**KingParity**](https://twitter.com/KingParity) 89 | - [**Dylan Stone**](https://twitter.com/notDylanstone) 90 | - [**Lil Fox YT**](https://twitter.com/TMBF_YT) 91 | - [**Jorc0**](https://twitter.com/Jorcus334) 92 | - [**Funnion**](https://nion.fun/) 93 | 94 | --- 95 | 96 | ## Still need help, or just want to chat? 97 | [Open a new issue here](https://github.com/ThatOneCalculator/DiscordRPCMaker/issues) or [join the Discord!](https://discord.gg/Z7UZPR3bbW) 98 | 99 | Made by [ThatOneCalculator](https://t1c.dev) and [KraXen72](https://github.com/kraxen72). Not officially affiliated with Discord. Thank you [discord.js](https://github.com/discordjs/rpc/), [electron-builder](https://electron.build), [fosscord-ui](https://github.com/fosscord/fosscord-ui), and all our lovely stargazers, helpers, translators, and users for making this project possible. Full credits are in the Instructions & Info menu in the program. 100 | -------------------------------------------------------------------------------- /style/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | 11 | html { 12 | line-height: 1.15; /* 1 */ 13 | -webkit-text-size-adjust: 100%; /* 2 */ 14 | } 15 | 16 | /* Sections 17 | ========================================================================== */ 18 | 19 | /** 20 | * Remove the margin in all browsers. 21 | */ 22 | 23 | body { 24 | margin: 0; 25 | } 26 | 27 | /** 28 | * Render the `main` element consistently in IE. 29 | */ 30 | 31 | main { 32 | display: block; 33 | } 34 | 35 | /** 36 | * Correct the font size and margin on `h1` elements within `section` and 37 | * `article` contexts in Chrome, Firefox, and Safari. 38 | */ 39 | 40 | h1 { 41 | font-size: 2em; 42 | margin: 0.67em 0; 43 | } 44 | 45 | /* Grouping content 46 | ========================================================================== */ 47 | 48 | /** 49 | * 1. Add the correct box sizing in Firefox. 50 | * 2. Show the overflow in Edge and IE. 51 | */ 52 | 53 | hr { 54 | box-sizing: content-box; /* 1 */ 55 | height: 0; /* 1 */ 56 | overflow: visible; /* 2 */ 57 | } 58 | 59 | /** 60 | * 1. Correct the inheritance and scaling of font size in all browsers. 61 | * 2. Correct the odd `em` font sizing in all browsers. 62 | */ 63 | 64 | pre { 65 | font-family: monospace, monospace; /* 1 */ 66 | font-size: 1em; /* 2 */ 67 | } 68 | 69 | /* Text-level semantics 70 | ========================================================================== */ 71 | 72 | /** 73 | * Remove the gray background on active links in IE 10. 74 | */ 75 | 76 | a { 77 | background-color: transparent; 78 | } 79 | 80 | /** 81 | * 1. Remove the bottom border in Chrome 57- 82 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 83 | */ 84 | 85 | abbr[title] { 86 | border-bottom: none; /* 1 */ 87 | text-decoration: underline; /* 2 */ 88 | text-decoration: underline dotted; /* 2 */ 89 | } 90 | 91 | /** 92 | * Add the correct font weight in Chrome, Edge, and Safari. 93 | */ 94 | 95 | b, 96 | strong { 97 | font-weight: bolder; 98 | } 99 | 100 | /** 101 | * 1. Correct the inheritance and scaling of font size in all browsers. 102 | * 2. Correct the odd `em` font sizing in all browsers. 103 | */ 104 | 105 | code, 106 | kbd, 107 | samp { 108 | font-family: monospace, monospace; /* 1 */ 109 | font-size: 1em; /* 2 */ 110 | } 111 | 112 | /** 113 | * Add the correct font size in all browsers. 114 | */ 115 | 116 | small { 117 | font-size: 80%; 118 | } 119 | 120 | /** 121 | * Prevent `sub` and `sup` elements from affecting the line height in 122 | * all browsers. 123 | */ 124 | 125 | sub, 126 | sup { 127 | font-size: 75%; 128 | line-height: 0; 129 | position: relative; 130 | vertical-align: baseline; 131 | } 132 | 133 | sub { 134 | bottom: -0.25em; 135 | } 136 | 137 | sup { 138 | top: -0.5em; 139 | } 140 | 141 | /* Embedded content 142 | ========================================================================== */ 143 | 144 | /** 145 | * Remove the border on images inside links in IE 10. 146 | */ 147 | 148 | img { 149 | border-style: none; 150 | } 151 | 152 | /* Forms 153 | ========================================================================== */ 154 | 155 | /** 156 | * 1. Change the font styles in all browsers. 157 | * 2. Remove the margin in Firefox and Safari. 158 | */ 159 | 160 | button, 161 | input, 162 | optgroup, 163 | select, 164 | textarea { 165 | font-family: inherit; /* 1 */ 166 | font-size: 100%; /* 1 */ 167 | line-height: 1.15; /* 1 */ 168 | margin: 0; /* 2 */ 169 | } 170 | 171 | /** 172 | * Show the overflow in IE. 173 | * 1. Show the overflow in Edge. 174 | */ 175 | 176 | button, 177 | input { 178 | /* 1 */ 179 | overflow: visible; 180 | } 181 | 182 | /** 183 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 184 | * 1. Remove the inheritance of text transform in Firefox. 185 | */ 186 | 187 | button, 188 | select { 189 | /* 1 */ 190 | text-transform: none; 191 | } 192 | 193 | /** 194 | * Correct the inability to style clickable types in iOS and Safari. 195 | */ 196 | 197 | button, 198 | [type="button"], 199 | [type="reset"], 200 | [type="submit"] { 201 | -webkit-appearance: button; 202 | } 203 | 204 | /** 205 | * Remove the inner border and padding in Firefox. 206 | */ 207 | 208 | button::-moz-focus-inner, 209 | [type="button"]::-moz-focus-inner, 210 | [type="reset"]::-moz-focus-inner, 211 | [type="submit"]::-moz-focus-inner { 212 | border-style: none; 213 | padding: 0; 214 | } 215 | 216 | /** 217 | * Restore the focus styles unset by the previous rule. 218 | */ 219 | 220 | button:-moz-focusring, 221 | [type="button"]:-moz-focusring, 222 | [type="reset"]:-moz-focusring, 223 | [type="submit"]:-moz-focusring { 224 | outline: 1px dotted ButtonText; 225 | } 226 | 227 | /** 228 | * Correct the padding in Firefox. 229 | */ 230 | 231 | fieldset { 232 | padding: 0.35em 0.75em 0.625em; 233 | } 234 | 235 | /** 236 | * 1. Correct the text wrapping in Edge and IE. 237 | * 2. Correct the color inheritance from `fieldset` elements in IE. 238 | * 3. Remove the padding so developers are not caught out when they zero out 239 | * `fieldset` elements in all browsers. 240 | */ 241 | 242 | legend { 243 | box-sizing: border-box; /* 1 */ 244 | color: inherit; /* 2 */ 245 | display: table; /* 1 */ 246 | max-width: 100%; /* 1 */ 247 | padding: 0; /* 3 */ 248 | white-space: normal; /* 1 */ 249 | } 250 | 251 | /** 252 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 253 | */ 254 | 255 | progress { 256 | vertical-align: baseline; 257 | } 258 | 259 | /** 260 | * Remove the default vertical scrollbar in IE 10+. 261 | */ 262 | 263 | textarea { 264 | overflow: auto; 265 | } 266 | 267 | /** 268 | * 1. Add the correct box sizing in IE 10. 269 | * 2. Remove the padding in IE 10. 270 | */ 271 | 272 | [type="checkbox"], 273 | [type="radio"] { 274 | box-sizing: border-box; /* 1 */ 275 | padding: 0; /* 2 */ 276 | } 277 | 278 | /** 279 | * Correct the cursor style of increment and decrement buttons in Chrome. 280 | */ 281 | 282 | [type="number"]::-webkit-inner-spin-button, 283 | [type="number"]::-webkit-outer-spin-button { 284 | height: auto; 285 | } 286 | 287 | /** 288 | * 1. Correct the odd appearance in Chrome and Safari. 289 | * 2. Correct the outline style in Safari. 290 | */ 291 | 292 | [type="search"] { 293 | -webkit-appearance: textfield; /* 1 */ 294 | outline-offset: -2px; /* 2 */ 295 | } 296 | 297 | /** 298 | * Remove the inner padding in Chrome and Safari on macOS. 299 | */ 300 | 301 | [type="search"]::-webkit-search-decoration { 302 | -webkit-appearance: none; 303 | } 304 | 305 | /** 306 | * 1. Correct the inability to style clickable types in iOS and Safari. 307 | * 2. Change font properties to `inherit` in Safari. 308 | */ 309 | 310 | ::-webkit-file-upload-button { 311 | -webkit-appearance: button; /* 1 */ 312 | font: inherit; /* 2 */ 313 | } 314 | 315 | /* Interactive 316 | ========================================================================== */ 317 | 318 | /* 319 | * Add the correct display in Edge, IE 10+, and Firefox. 320 | */ 321 | 322 | details { 323 | display: block; 324 | } 325 | 326 | /* 327 | * Add the correct display in all browsers. 328 | */ 329 | 330 | summary { 331 | display: list-item; 332 | } 333 | 334 | /* Misc 335 | ========================================================================== */ 336 | 337 | /** 338 | * Add the correct display in IE 10+. 339 | */ 340 | 341 | template { 342 | display: none; 343 | } 344 | 345 | /** 346 | * Add the correct display in IE 10. 347 | */ 348 | 349 | [hidden] { 350 | display: none; 351 | } 352 | -------------------------------------------------------------------------------- /main.js: -------------------------------------------------------------------------------- 1 | // libappindicator-gtk3 on Arch as req 2 | const { app, BrowserWindow, Notification, Menu, MenuItem, ipcMain, Tray, dialog } = require("electron") 3 | const path = require('path') 4 | const fs = require('fs') 5 | const os = require('os') 6 | const RPC = require('discord-rpc') 7 | const EventEmitter = require('events') 8 | require('@electron/remote/main').initialize() 9 | const iconpath = path.join(__dirname, "/assets/icon.png") 10 | const loadingEvents = new EventEmitter() 11 | const slash = os.platform() == 'win32' ? "\\" : "/" 12 | let dir = `${os.userInfo().homedir}/${process.platform === 'win32' ? '/AppData/Roaming/drpcm/' : '/.config/drpcm/'}` 13 | let opendir = dir.replaceAll("/", "\\").replaceAll("\\\\", "\\") 14 | 15 | let win = null 16 | 17 | const args = process.argv.slice(2) 18 | const id = args[0] 19 | 20 | if (id !== undefined) { 21 | const slash = os.platform() == 'win32' ? "\\" : "/" 22 | const dir = `${os.userInfo().homedir}/${process.platform === 'win32' ? '/AppData/Roaming/drpcm/' : '/.config/drpcm/'}` 23 | let client = new RPC.Client({ transport: 'ipc' }) 24 | 25 | let opendir = dir.replace("/", "\\").replace("\\\\", "\\") 26 | let fullpath = os.platform() == "win32" ? opendir + "\\" + id + ".json" : dir + "/" + id + ".json" 27 | let settingspath = os.platform() == "win32" ? opendir + "\\" + "settings.json" : dir + "/" + "settings.json" 28 | let options = JSON.parse(fs.readFileSync(fullpath, 'utf8')) 29 | let settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 30 | let activity = {} 31 | let assets = {} 32 | 33 | if (options.largeimage !== '') { 34 | activity.largeImageKey = options.largeimage 35 | // If you change this and some asks about this, please still give me credit :) 36 | activity.largeImageText = "Made with ThatOneCalculator's Discord RPC Maker (v2.0.9 CLI)!" 37 | } 38 | if (options.smallimage !== '') { 39 | activity.smallImageKey = options.smallimage 40 | // Same applies with assets.large_text 41 | activity.smallImageText = 'https://drpcm.t1c.dev/' 42 | } 43 | if (assets !== {}) { activity.assets = assets } 44 | if (options.description !== '') { activity.details = options.description } 45 | if (options.state !== '') { activity.state = options.state } 46 | if (options.buttons.length !== 0) { activity.buttons = options.buttons } 47 | 48 | if (settings.showtimestamp == true) { 49 | activity.startTimestamp = Date.now() 50 | } 51 | 52 | function assembleClient(timeout = 5000) { 53 | client.destroy() 54 | client = new RPC.Client({ transport: 'ipc' }) 55 | client.on('ready', () => { 56 | running = true; 57 | client.setActivity(activity); 58 | client.transport.socket.on("close", (c, s) => { 59 | assembleClient() 60 | }) 61 | }) 62 | setTimeout(() => client.login({ clientId: options.clientid }), timeout) 63 | } 64 | 65 | process.on("unhandledRejection", e => { 66 | if (e.message === "Could not connect") { 67 | console.log("Crashed! Retrying...") 68 | assembleClient() 69 | } 70 | }) 71 | 72 | assembleClient(1000) 73 | 74 | console.log("Started!") 75 | } 76 | 77 | else { 78 | function createWindow() { 79 | win = new BrowserWindow({ 80 | width: 1200, 81 | height: 700, 82 | minWidth: 900, 83 | minHeight: 600, 84 | webPreferences: { 85 | contextIsolation: true, 86 | nodeIntegration: true, 87 | enableRemoteModule: true, 88 | preload: path.join(__dirname, "preload.js"), 89 | icon: iconpath 90 | } 91 | }) 92 | 93 | let settings = {} 94 | 95 | if (!fs.existsSync(dir)) { 96 | initialdata = { 97 | launchedpresence: false, 98 | language: "english", 99 | theme: "dark", 100 | quitonx: false, 101 | showtimestamp: false 102 | } 103 | if (os.platform() == "win32") { 104 | fs.mkdirSync(opendir, { recursive: true }) 105 | } 106 | else { 107 | fs.mkdirSync(dir, { recursive: true }) 108 | } 109 | fs.copyFileSync(`${path.join(__dirname, `${slash}themes${slash}dark.css`)}`, `${dir}${slash}custom.css`) 110 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(initialdata, null, 2), 'utf8', (err) => { 111 | if (err) { throw err } 112 | else { console.log("First launch") } 113 | }) 114 | //welcome message 115 | const msg = { 116 | type: 'question', 117 | buttons: [], 118 | defaultId: 0, 119 | title: 'Welcome', 120 | message: 'Thank you for choosing Discord RPC Maker!', 121 | detail: 'If you need instructions, click the question (?) icon in the bottom right.', 122 | }; 123 | dialog.showMessageBox(null, msg) 124 | } 125 | 126 | 127 | try { 128 | 129 | let settingspath = os.platform() == "win32" ? opendir + "\\" + "settings.json" : dir + "/" + "settings.json" 130 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 131 | } 132 | catch (e) { 133 | console.log(e) 134 | fs.mkdirSync(dir, { recursive: true }) 135 | settings = { 136 | launchedpresence: false, 137 | language: "english", 138 | theme: "dark", 139 | quitonx: false, 140 | showtimestamp: false 141 | } 142 | fs.writeFileSync(`${dir}${slash}settings.json`, JSON.stringify(settings, null, 2), 'utf8', (err) => { 143 | if (err) { throw err } 144 | else { console.log("Wrote base settings") } 145 | }) 146 | } 147 | if (settings['quitonx'] == false) { 148 | win.on('minimize', function (event) { 149 | event.preventDefault(); 150 | win.hide(); 151 | }) 152 | 153 | win.on('close', function (event) { 154 | if (!app.isQuiting) { 155 | event.preventDefault(); 156 | win.hide(); 157 | } 158 | 159 | return false; 160 | }) 161 | } 162 | win.setIcon(iconpath) 163 | //win.setResizable(false); 164 | const menu = Menu() 165 | win.setMenuBarVisibility(false) 166 | 167 | //start loading screen 168 | win.loadFile("loading.html") 169 | 170 | loadingEvents.on('finished', () => { 171 | win.loadFile('index.html') 172 | }) 173 | 174 | //load for one second, then do an internet check 175 | setTimeout(() => { 176 | require('dns').resolve("https://drpcm.t1c.dev", function (err) { 177 | if (err) { 178 | noInternet(win) 179 | } else { 180 | setTimeout(() => loadingEvents.emit('finished'), 250) 181 | } 182 | }) 183 | }, 150) 184 | 185 | function noInternet() { 186 | require('dns').resolve("https://drpcm.t1c.dev", function (err) { 187 | if (err) { 188 | win.webContents.send("no-internet") 189 | console.log("sending no internet") 190 | setTimeout(noInternet, 5000) 191 | } else { 192 | //when we connect just stop loading 193 | loadingEvents.emit('finished') 194 | } 195 | }) 196 | } 197 | app.on('window-all-closed', () => { 198 | if (process.platform !== 'darwin') { 199 | app.quit(); 200 | } 201 | }) 202 | app.on('before-quit', () => { 203 | win.removeAllListeners('close'); 204 | win.close(); 205 | }) 206 | } 207 | 208 | 209 | 210 | const gotTheLock = app.requestSingleInstanceLock() 211 | 212 | if (!gotTheLock) { 213 | app.quit() 214 | } 215 | else { 216 | app.on('second-instance', (event, commandLine, workingDirectory) => { 217 | // Someone tried to run a second instance, we should focus our window. 218 | if (win) { 219 | if (win.isMinimized()) win.restore() 220 | win.focus() 221 | win.show() 222 | } 223 | }) 224 | 225 | // Create myWindow, load the rest of the app, etc... 226 | app.whenReady().then(() => { 227 | createWindow() 228 | win = BrowserWindow.getAllWindows()[0] 229 | if (os.platform() == "darwin") { 230 | appIcon = new Tray(path.join(__dirname, "/assets/iconTemplate.png")) 231 | } 232 | else { 233 | appIcon = new Tray(iconpath) 234 | } 235 | const contextMenu = new Menu() 236 | contextMenu.append(new MenuItem({ 237 | label: 'Show Discord RPC Maker', 238 | click: () => { app.isquitting = true; win.show() } 239 | })) 240 | contextMenu.append(new MenuItem({ 241 | label: 'Quit Discord RPC Maker', 242 | click: () => { app.quit() } 243 | })) 244 | appIcon.setContextMenu(contextMenu) 245 | appIcon.setToolTip("Discord RPC Maker") 246 | }) 247 | } 248 | 249 | 250 | app.on("activate", () => { 251 | if (BrowserWindow.getAllWindows().length === 0) { 252 | createWindow() 253 | } 254 | }) 255 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Discord RPC Maker 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 246 |

247 | 248 | 249 | 250 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /preload.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const os = require('os') 3 | const path = require('path') 4 | const RPC = require('discord-rpc') 5 | const openExplorer = require('open-file-explorer') 6 | // const keytar = require('keytar') 7 | const { ipcRenderer } = require('electron') 8 | const { dialog, shell, BrowserWindow } = require('@electron/remote') 9 | const execSync = require('child_process').execSync 10 | 11 | const slash = os.platform() == 'win32' ? "\\" : "/" 12 | 13 | const dir = `${os.userInfo().homedir}/${process.platform === 'win32' ? '/AppData/Roaming/drpcm/' : '/.config/drpcm/'}` 14 | const opendir = dir.replaceAll("/", "\\").replaceAll("\\\\", "\\") 15 | const settingspath = os.platform() == "win32" ? opendir + "\\" + "settings.json" : dir + "/" + "settings.json" 16 | let settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 17 | let theme = settings["theme"] 18 | 19 | let clientID = 0 20 | let options = {} 21 | let client = new RPC.Client({ transport: 'ipc' }) 22 | 23 | let inputs = [] 24 | let selects = [] 25 | 26 | let activity = {} 27 | let assets = {} 28 | 29 | //check for appdata / .config dir and make it if it doesen't exist 30 | if (!fs.existsSync(dir)) { 31 | initialdata = { 32 | launchedpresence: false, 33 | language: "english", 34 | theme: "dark", 35 | quitonx: false, 36 | showtimestamp: false 37 | } 38 | fs.mkdirSync(dir, { recursive: true }) 39 | fs.copyFileSync(`${path.join(__dirname, `${slash}themes${slash}dark.css`)}`, `${dir}${slash}custom.css`) 40 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(initialdata, null, 2), 'utf8', (err) => { 41 | if (err) { throw err } 42 | else { console.log("First launch") } 43 | }) 44 | //welcom emessage 45 | const msg = { 46 | type: 'question', 47 | buttons: [], 48 | defaultId: 0, 49 | title: 'Welcome', 50 | message: 'Thank you for choosing Discord RPC Maker!', 51 | detail: 'If you need instructions, click the question (?) icon in the bottom right.', 52 | }; 53 | dialog.showMessageBox(null, msg) 54 | } 55 | 56 | //esc to exit out of faq and settings 57 | window.addEventListener("keydown", (event) => { 58 | if (event.key !== "Escape") { return } 59 | try { 60 | closeFaqModal() 61 | closeSettingsModal() 62 | } catch (e) { } 63 | 64 | console.log(event); 65 | }); 66 | 67 | //make the border red if url validation fails 68 | function updateValidButton(button, elem) { 69 | url = elem.value 70 | isValid = validateurl(url) 71 | 72 | if (isValid) { 73 | button.classList.remove("danger") 74 | elem.classList.add("input-success") 75 | } else { 76 | elem.classList.remove("input-success") 77 | button.classList.add("danger") 78 | } 79 | } 80 | 81 | //save presence as json 82 | function saveAsJson() { 83 | let presencename = document.getElementById("presence-name-input").value.toString() 84 | if (presencename.length == 0) { 85 | const msg = { 86 | type: 'error', 87 | title: 'Error', 88 | message: 'You need to have a title.', 89 | } 90 | dialog.showMessageBox(null, msg) 91 | document.getElementById("test").setAttribute("disabled", "true") 92 | return 93 | } 94 | let presenceid = document.getElementById("presence-id").value.toString() 95 | 96 | let description = document.getElementById("description-input-1").value.toString() 97 | if (description.length == 1) { description += "_" } 98 | let state = document.getElementById("description-input-2").value.toString() 99 | if (state.length == 1) { state += "_" } 100 | let largeimage = document.getElementById("large-image-input").value.toString() 101 | let smallimage = document.getElementById("small-image-input").value.toString() 102 | largeimage = largeimage == "None" ? "" : largeimage 103 | smallimage = smallimage == "None" ? "" : smallimage 104 | let buttononelabel = document.getElementById("button1-input-name").value.toString() 105 | let buttononeurl = document.getElementById("button1-input-url").value.toString() 106 | if (!buttononeurl.startsWith('http')) { buttononeurl = 'https://' + buttononeurl } 107 | let buttontwolabel = document.getElementById("button2-input-name").value.toString() 108 | let buttontwourl = document.getElementById("button2-input-url").value.toString() 109 | if (!buttontwourl.startsWith('http')) { buttontwourl = 'https://' + buttontwourl } 110 | buttonone = { label: buttononelabel, url: buttononeurl } 111 | buttontwo = { label: buttontwolabel, url: buttontwourl } 112 | const buttons = [] 113 | if (document.getElementById("button1-enable").checked && validateurl(buttononeurl)) { buttons.push(buttonone) } 114 | if (document.getElementById("button2-enable").checked && validateurl(buttontwourl)) { buttons.push(buttontwo) } 115 | const content = { 116 | name: presencename, 117 | clientid: clientID, 118 | description: description, 119 | state: state, 120 | largeimage: largeimage, 121 | smallimage: smallimage, 122 | buttons: buttons 123 | } 124 | 125 | const data = JSON.stringify(content, null, 2) 126 | let filename = presenceid == "" ? generateId(10) : presenceid 127 | fs.writeFileSync(`${dir}${slash}${filename}.json`, data, 'utf8', (err) => { 128 | if (err) { throw err } 129 | else { console.log("saved") } 130 | }) 131 | return filename 132 | } 133 | 134 | //fetch discord for images, fill in selects and enable inputs 135 | async function bootClientId(presence, ready) { 136 | //checks what is in clientid input 137 | let inp = document.querySelector(".client-id-enabler") 138 | let enableOnClientid = document.querySelectorAll(".enable-on-clientid") 139 | enableOnClientid.forEach((item, i, arr) => { 140 | item.disabled = true; 141 | }) 142 | document.getElementById("large-image-div").classList.add("customdisabled") 143 | document.getElementById("small-image-div").classList.add("customdisabled") 144 | 145 | let button1enable = document.getElementById("button1-enable") 146 | let button2enable = document.getElementById("button2-enable") 147 | let btn1label = document.getElementById("button1-input-name") 148 | let btn1url = document.getElementById("button1-input-url") 149 | let btn2label = document.getElementById("button2-input-name") 150 | let btn2url = document.getElementById("button2-input-url") 151 | 152 | btn1label.value = "" 153 | btn2label.value = "" 154 | btn1url.value = "" 155 | btn2url.value = "" 156 | if (button1enable.checked) { button1enable.click() } 157 | document.getElementById("small-image").src = "assets/blank.png" 158 | 159 | //checks if clientid input has a valid clientid (long enough, only numbers) 160 | if (presence.addDanger == true) { 161 | inp.classList.remove("input-success") 162 | inp.classList.add("input-danger") 163 | } 164 | if (inp.value !== "" && inp.value.toString().length > 17 && isNaN(parseInt(inp.value)) == false) { 165 | //call discord api to make sure clientid is valid 166 | let response = await fetch(`https://discord.com/api/oauth2/applications/${inp.value.toString()}/assets`) 167 | if (response.ok) { 168 | //client id is valid, enable inputs 169 | options = await fetch(`https://discord.com/api/oauth2/applications/${inp.value.toString()}/assets`).then(options => options.json()) 170 | clientID = inp.value//get clientid and store it 171 | 172 | console.log(options) 173 | 174 | //enable everything on valid clientid 175 | enableOnClientid.forEach((item, i, arr) => { 176 | item.removeAttribute("disabled") 177 | }) 178 | document.getElementById("large-image-div").classList.remove("customdisabled") 179 | document.getElementById("small-image-div").classList.remove("customdisabled") 180 | 181 | //populate the image select options with fetched names of images from the discord api 182 | imageinputs = document.querySelectorAll("#large-image-input, #small-image-input") 183 | imageinputs.forEach((item, i, arr) => { 184 | htmll = '' 185 | htmll += item == document.getElementById('large-image-input') ? '' : '' 186 | htmll += '' 187 | options.forEach((opt, index, array) => { 188 | htmll += `` 189 | }) 190 | item.innerHTML = htmll 191 | }) 192 | 193 | //if we are loading a presence 194 | console.log("loading: ", presence) 195 | if (Object.keys(presence).length > 0) { 196 | //console.log("loading: ", presence) 197 | 198 | let largeimg = document.getElementById("large-image-input") 199 | let smallimg = document.getElementById("small-image-input") 200 | let desc1 = document.getElementById("description-input-1") 201 | let desc2 = document.getElementById("description-input-2") 202 | 203 | 204 | //fill in the values from provided presence, and simulate user clicking / typing in the inputs, so the preview updates. 205 | largeimg.querySelectorAll("option").forEach(opt => { 206 | if (opt.getAttribute("selected") == "selected") { 207 | opt.removeAttribute("selected") 208 | } 209 | }) 210 | largeimg.querySelectorAll("option").forEach(opt => { 211 | if (opt.innerText == presence.largeimage) { 212 | opt.setAttribute("selected", "selected") 213 | } 214 | }) 215 | largeimg.dispatchEvent(new Event("change")) 216 | 217 | smallimg.querySelectorAll("option").forEach(opt => { 218 | if (opt.getAttribute("selected") == "selected") { 219 | opt.removeAttribute("selected") 220 | } 221 | }) 222 | smallimg.querySelectorAll("option").forEach(opt => { 223 | if (opt.innerText == presence.smallimage) { 224 | opt.setAttribute("selected", "selected") 225 | } 226 | }) 227 | smallimg.dispatchEvent(new Event("change")) 228 | 229 | desc1.value = presence.description 230 | desc2.value = presence.state 231 | 232 | desc1.dispatchEvent(new Event("input")) 233 | desc2.dispatchEvent(new Event("input")) 234 | 235 | if (presence.buttons.length > 0) { 236 | if (presence.buttons.length == 2) { 237 | button1enable.checked = false; 238 | button2enable.checked = false; 239 | button1enable.click() 240 | button2enable.click() 241 | 242 | btn1label.value = presence.buttons[0].label 243 | btn1url.value = presence.buttons[0].url 244 | 245 | btn2label.value = presence.buttons[1].label 246 | btn2url.value = presence.buttons[1].url 247 | 248 | } else if (presence.buttons.length == 1) { 249 | button1enable.checked = false; 250 | button1enable.click() 251 | 252 | btn1label.value = presence.buttons[0].label 253 | btn1url.value = presence.buttons[0].url 254 | } 255 | btn1label.dispatchEvent(new Event("input")) 256 | btn2label.dispatchEvent(new Event("input")) 257 | btn1url.dispatchEvent(new Event("input")) 258 | btn2url.dispatchEvent(new Event("input")) 259 | } 260 | 261 | } 262 | inp.classList.remove("input-danger") 263 | inp.classList.add("input-success") 264 | } else { 265 | inp.classList.remove("input-success") 266 | inp.classList.add("input-danger") 267 | } 268 | } 269 | if (ready == true) { 270 | document.getElementById("test").removeAttribute("disabled") 271 | } 272 | } 273 | 274 | //load a presence - celar al inputs 275 | function loadPresence(presence, file) { 276 | document.getElementById("presence-id").value = file.replaceAll(".json", "") 277 | document.getElementById("presence-name-input").value = presence.name 278 | document.getElementById("clientid-input").value = presence.clientid 279 | document.getElementById("del-btn").removeAttribute("disabled") 280 | document.getElementById("file-btn").removeAttribute("disabled") 281 | try { bootClientId(presence, true) } catch (e) { } 282 | } 283 | 284 | //what to do when dom loads 285 | document.addEventListener("DOMContentLoaded", () => { 286 | if (document.getElementById("no-internet-msg") != null) { 287 | console.log("waiting for no internet") 288 | ipcRenderer.on('no-internet', (event, arg) => { 289 | document.getElementById("no-internet-msg").style.display = "block" 290 | }); 291 | } 292 | 293 | console.log("loaded") 294 | 295 | // Check for updates 296 | function checkForUpdates() { 297 | let run = false 298 | 299 | const latestVersion = require('latest-version'); 300 | 301 | (async () => { 302 | const ver = await latestVersion('discordrpcmaker') 303 | console.log(ver) 304 | if (ver != '2.0.9' && !run) { 305 | const msg = { 306 | type: 'question', 307 | buttons: ['No thanks', 'Update!'], 308 | defaultId: 1, 309 | title: 'Update', 310 | message: 'An update is avaliable! Please follow the link to redownload this program.', 311 | } 312 | dialog.showMessageBox(null, msg).then(result => { 313 | if (result.response == 1) { 314 | shell.openExternal('https://drpcm.t1c.dev/#install') 315 | } 316 | }) 317 | run = true 318 | return; 319 | } 320 | })() 321 | } 322 | 323 | checkForUpdates() 324 | 325 | //load presences 326 | loadSavedPresences() 327 | 328 | //for testing 329 | // loadLang("german") 330 | 331 | inputs = [ 332 | document.getElementById("clientid-input"), 333 | document.getElementById("presence-name-input"), 334 | /*document.getElementById("large-image-input"), 335 | document.getElementById("small-image-input"),*/ 336 | document.getElementById("description-input-1"), 337 | document.getElementById("description-input-2"), 338 | document.getElementById("presence-id"), 339 | document.getElementById("small-image-input") 340 | ] 341 | 342 | setTimeout(() => { document.getElementById("fader").style.opacity = "0" }, 250) 343 | setTimeout(() => { document.getElementById("fader").remove() }, 500) 344 | 345 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 346 | theme = settings["theme"] 347 | if (theme == "pywal") { 348 | let themedir = path.join(__dirname, `${slash}themes${slash}${theme}.css`) 349 | pywalcss = fs.readFileSync(themedir, 'utf8').replaceAll("HOMEDIR", os.homedir) 350 | addStyle(pywalcss) 351 | } 352 | else if (theme == "custom") { 353 | addStyle(fs.readFileSync(`${dir}${slash}custom.css`, 'utf8')) 354 | } 355 | else { 356 | let themedir = path.join(__dirname, `${slash}themes${slash}${theme}.css`) 357 | addStyle(fs.readFileSync(themedir, 'utf8')) 358 | } 359 | 360 | if (os.platform() != "win32") { 361 | try { 362 | const output = execSync('which wal', { encoding: 'utf-8' }).toLowerCase() 363 | if (!output.indexOf("not found") >= 0) { 364 | document.getElementById("pywaloption").removeAttribute("hidden") 365 | } 366 | } 367 | catch (e) { } 368 | } 369 | 370 | //stop presence of 371 | document.getElementById("stop").addEventListener("click", () => { 372 | client.destroy() 373 | document.getElementById("stop").setAttribute("hidden", "true") 374 | document.getElementById("test").setAttribute("class", "btn primary enable-on-clientid mr") 375 | document.getElementById("pfp").setAttribute("src", "assets/wumpsearch.gif") 376 | }) 377 | //launch presence 378 | document.getElementById("test").addEventListener("click", () => { 379 | client.destroy() 380 | 381 | id = document.getElementById("presence-id").value 382 | fullpath = os.platform() == "win32" ? opendir + "\\" + id + ".json" : dir + "/" + id + ".json" 383 | options = JSON.parse(fs.readFileSync(fullpath, 'utf8')) 384 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 385 | activity = {} 386 | assets = {} 387 | 388 | if (options.largeimage !== '') { 389 | activity.largeImageKey = options.largeimage 390 | // If you change this and some asks about this, please still give me credit :) 391 | activity.largeImageText = "Made with ThatOneCalculator's Discord RPC Maker (v2.0)!" 392 | } 393 | if (options.smallimage !== '') { 394 | activity.smallImageKey = options.smallimage 395 | // Same applies with assets.large_text 396 | activity.smallImageText = 'https://drpcm.t1c.dev/' 397 | } 398 | if (assets !== {}) { activity.assets = assets } 399 | if (options.description !== '') { activity.details = options.description } 400 | if (options.state !== '') { activity.state = options.state } 401 | if (options.buttons.length !== 0) { activity.buttons = options.buttons } 402 | 403 | 404 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 405 | if (settings.showtimestamp == true) { 406 | activity.startTimestamp = Date.now() 407 | } 408 | 409 | function assembleClient(timeout = 5000) { 410 | console.log(options) 411 | client.destroy() 412 | client = new RPC.Client({ transport: 'ipc' }) 413 | client.on('ready', () => { 414 | running = true; 415 | client.setActivity(activity); 416 | client.transport.socket.on("close", (c, s) => { 417 | assembleClient() 418 | }) 419 | }) 420 | setTimeout(() => client.login({ clientId: options.clientid }), timeout) 421 | } 422 | 423 | process.on("unhandledRejection", e => { 424 | if (e.message === "Could not connect") { 425 | assembleClient() 426 | } 427 | }) 428 | 429 | assembleClient(1000) 430 | 431 | /*const myNotification = new Notification("Discord RPC Maker", { 432 | body: "Your presence has started.", 433 | icon: "assets/icon.png", 434 | timeoutType: "default", 435 | })*/ 436 | console.log("started") 437 | document.getElementById("stop").removeAttribute("hidden") 438 | document.getElementById("pfp").setAttribute("src", "assets/wumpus.gif") 439 | document.getElementById("test").setAttribute("class", "btn success enable-on-clientid mr") 440 | if (settings.launchedpresence == false) { 441 | settings.launchedpresence = true 442 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(settings, null, 2), 'utf8', (err) => { 443 | if (err) { throw err } 444 | else { 445 | const msg = { 446 | type: 'question', 447 | buttons: ['Close', 'Star on GitHub', 'Join the Discord', 'Donate'], 448 | defaultId: 0, 449 | title: 'Welcome', 450 | message: 'Congrats, you launched your first presence!', 451 | detail: 'Don\'t worry, this is the last time you\'ll see this. This project is and always will be free and open source. If you want to show your support, please consider donating, leaving a star on the GitHub, and/or joining the Discord server.', 452 | }; 453 | dialog.showMessageBox(null, msg).then(result => { 454 | if (result.response == 1) { 455 | shell.openExternal('https://github.com/thatonecalculator/discordrpcmaker') 456 | } 457 | if (result.response == 2) { 458 | shell.openExternal('https://discord.com/invite/Z7UZPR3bbW') 459 | } 460 | if (result.response == 3) { 461 | shell.openExternal('https://buymeacoffee.com/that1calculator') 462 | } 463 | }) 464 | } 465 | }) 466 | } 467 | 468 | }); 469 | 470 | document.getElementById("themedropdown").addEventListener("change", function () { 471 | let e = document.getElementById("themedropdown") 472 | let selected = e.options[e.selectedIndex].text 473 | 474 | 475 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 476 | theme = "dark" 477 | theme = selected.toLowerCase().replaceAll(" ", "").replaceAll("é", "e") 478 | if (theme == "pywal") { 479 | let themedir = path.join(__dirname, `${slash}themes${slash}${theme}.css`) 480 | pywalcss = fs.readFileSync(themedir, 'utf8').replaceAll("HOMEDIR", os.homedir) 481 | console.log(pywalcss) 482 | addStyle(pywalcss) 483 | } 484 | else if (theme == "custom") { 485 | addStyle(fs.readFileSync(`${dir}${slash}custom.css`, 'utf8')) 486 | } 487 | else { 488 | let themedir = path.join(__dirname, `${slash}themes${slash}${theme}.css`) 489 | addStyle(fs.readFileSync(themedir, 'utf8')) 490 | } 491 | settings.theme = theme 492 | console.log(settings) 493 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(settings, null, 2), 'utf8', (err) => { 494 | if (err) { throw err } 495 | else { } 496 | }) 497 | }); 498 | 499 | 500 | document.getElementById("new-presence-button").addEventListener("click", () => { 501 | let empty = { 502 | buttons: [], 503 | clientid: "", 504 | description: "", 505 | largeimage: "", 506 | smallimage: "", 507 | name: "", 508 | state: "", 509 | addDanger: true 510 | } 511 | inputs.forEach((input) => { 512 | input.value = "" 513 | input.dispatchEvent(new Event("input")) 514 | }) 515 | document.getElementById("large-image-input").innerHTML = ` 516 | 517 | 518 | ` 519 | document.getElementById("small-image-input").innerHTML = ` 520 | 521 | 522 | ` 523 | 524 | document.getElementById("small-image-input").setAttribute("disabled", "true") 525 | document.getElementById("del-btn").setAttribute("disabled", "true") 526 | document.querySelector(".preview-pfp").setAttribute("src", "assets/wumpsearch.gif") 527 | document.getElementById("large-image").setAttribute("src", "assets/placeholder.png") 528 | 529 | // document.getElementById("file-btn").setAttribute("disabled", "true") 530 | bootClientId(empty, false) 531 | }); 532 | 533 | //save presence 534 | function savePresence() { 535 | filename = saveAsJson() 536 | reloadPresences() 537 | //document.getElementById("new-presence-button").click() 538 | document.getElementById("del-btn").removeAttribute("disabled") 539 | // document.getElementById("file-btn").removeAttribute("disabled") 540 | document.getElementById("presence-id").value = filename 541 | document.getElementById("test").removeAttribute("disabled") 542 | } 543 | 544 | document.getElementById("save").addEventListener("click", () => { 545 | savePresence() 546 | setTimeout(() => { document.getElementById("test").removeAttribute("disabled") }, 2000) 547 | }); 548 | 549 | document.getElementById("del-btn").addEventListener("click", () => { 550 | const options = { 551 | type: 'question', 552 | buttons: ['Cancel', 'Delete'], 553 | defaultId: 0, 554 | title: 'Delete presence', 555 | message: 'Are you sure you want to delete this presence?', 556 | detail: 'This cannot be undone.', 557 | }; 558 | dialog.showMessageBox(null, options).then(result => { 559 | if (result.response == 1) { //delete the presence 560 | 561 | let id = document.getElementById("presence-id").value 562 | let fullpath = os.platform() == "win32" ? opendir + "\\" + id + ".json" : dir + "/" + id + ".json" 563 | 564 | //delete the file 565 | fs.stat(fullpath, function (err, stat) { 566 | if (err == null) { //get if it exists 567 | console.log(`${id}.json exists`); 568 | fs.unlink(fullpath, (err) => { 569 | if (err) { throw err; } 570 | console.log("File is deleted."); //log that we deleted it 571 | reloadPresences(); //reload the presences 572 | const myNotification = new Notification("Discord RPC Maker", { //throw a notification 573 | body: `'${document.getElementById("presence-name-input").value}' has been deleted.`, 574 | icon: "assets/icon.png", 575 | timeoutType: "default", 576 | }) 577 | document.getElementById("new-presence-button").click() //clear all inputs 578 | }); 579 | 580 | } else if (err.code === 'ENOENT') { //if it doesen't exist then don't delete it lul 581 | console.log(`${id}.json doesen't exist, nothing deleted.`) 582 | } else { 583 | alert('error while trying to delete file: ', err.code); 584 | } 585 | 586 | }); 587 | } 588 | }).catch(err => { 589 | console.log("error while trying to create message box: " + err) 590 | }) 591 | }) 592 | 593 | document.getElementById("file-btn").addEventListener("click", () => { 594 | 595 | if (process.platform !== "win32") { openExplorer(dir) } 596 | else { openExplorer(opendir) } 597 | }) 598 | 599 | //Easter eggs 600 | 601 | //enable inputs 602 | document.querySelector(".client-id-enabler").addEventListener("input", () => { bootClientId({}, false) }) 603 | 604 | document.getElementById("quitonclose-btn") 605 | 606 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 607 | if (settings.quitonx) { document.getElementById("quitonclose-btn").click() } 608 | if (settings.showtimestamp) { document.getElementById("showtimestamp-btn").click() } 609 | 610 | document.getElementById("quitonclose-btn").addEventListener("change", () => { 611 | 612 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 613 | settings.quitonx = !settings['quitonx'] 614 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(settings, null, 2), 'utf8', (err) => { 615 | if (err) { throw err } 616 | else { } 617 | }) 618 | const msg = { 619 | type: 'question', 620 | buttons: [], 621 | defaultId: 0, 622 | title: 'Notice', 623 | message: 'This setting will take affect next launch.', 624 | } 625 | dialog.showMessageBox(null, msg) 626 | }) 627 | 628 | document.getElementById("showtimestamp-btn").addEventListener("change", () => { 629 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 630 | settings.showtimestamp = !settings['showtimestamp'] 631 | fs.writeFile(`${dir}${slash}settings.json`, JSON.stringify(settings, null, 2), 'utf8', (err) => { 632 | if (err) { throw err } 633 | else { } 634 | }) 635 | const msg = { 636 | type: 'question', 637 | buttons: [], 638 | defaultId: 0, 639 | title: 'Notice', 640 | message: 'This setting will take affect the next time you click the Launch Presence button.', 641 | } 642 | dialog.showMessageBox(null, msg) 643 | }) 644 | 645 | //button enabling 646 | //enabling of first button 647 | document.getElementById("button1-enable").addEventListener("change", () => { 648 | notReady() 649 | if (document.getElementById("button1-enable").checked) { 650 | //enable all buttons 651 | inps = document.querySelector(".button1") 652 | inps.querySelectorAll('input[disabled]').forEach((item, i, arr) => { 653 | item.removeAttribute("disabled"); 654 | }); 655 | 656 | document.getElementById('button2-enable').removeAttribute('disabled') 657 | document.getElementById("preview-button-1").classList.remove("initially-hidden") 658 | document.getElementById("button1-input-name").addEventListener("input", () => { updatePreview("btn1name") }) 659 | document.getElementById("button1-input-url").addEventListener("input", () => { updatePreview("btn1url") }) 660 | } else { 661 | //disable buttons 662 | inps = document.querySelector(".button1") 663 | inps.querySelectorAll('input[type="text"]').forEach((item, i, arr) => { 664 | item.setAttribute("disabled", ""); 665 | }); 666 | 667 | button2enable = document.getElementById('button2-enable') 668 | document.getElementById("preview-button-1").classList.add("initially-hidden") 669 | if (button2enable.checked == true) { button2enable.click() } 670 | button2enable.disabled = true; 671 | 672 | try { 673 | //remove listeners for both buttons 674 | document.getElementById("button1-input-name").removeEventListener("input", () => { updatePreview("btn1name") }) 675 | document.getElementById("button1-input-url").removeEventListener("input", () => { updatePreview("btn1url") }) 676 | document.getElementById("button2-input-name").removeEventListener("input", () => { updatePreview("btn2name") }) 677 | document.getElementById("button2-input-url").removeEventListener("input", () => { updatePreview("btn2url") }) 678 | } catch (e) { } 679 | } 680 | }); 681 | //enabling of second button 682 | document.getElementById("button2-enable").addEventListener("change", () => { 683 | notReady() 684 | if (document.getElementById("button2-enable").checked) { 685 | //enable second button 686 | inps = document.querySelector(".button2") 687 | inps.querySelectorAll('input:disabled').forEach((item, i, arr) => { 688 | item.removeAttribute("disabled"); 689 | }); 690 | document.getElementById("preview-button-2").classList.remove("initially-hidden") 691 | document.getElementById("button2-input-name").addEventListener("input", () => { updatePreview("btn2name") }) 692 | document.getElementById("button2-input-url").addEventListener("input", () => { updatePreview("btn2url") }) 693 | } else { 694 | inps = document.querySelector(".button2") 695 | //disable second button 696 | inps.querySelectorAll('input[type="text"]').forEach((item, i, arr) => { 697 | item.setAttribute("disabled", ""); 698 | }); 699 | document.getElementById("preview-button-2").classList.add("initially-hidden") 700 | document.getElementById("button2-input-name").removeEventListener("input", () => { updatePreview("btn2name") }) 701 | document.getElementById("button2-input-url").removeEventListener("input", () => { updatePreview("btn2url") }) 702 | } 703 | }); 704 | 705 | //description line 1 updating 706 | document.getElementById("description-input-1").addEventListener("input", () => { 707 | updatePreview("desc1") 708 | }); 709 | 710 | //description line 2 updating 711 | document.getElementById("description-input-2").addEventListener("input", () => { 712 | updatePreview("desc2") 713 | }); 714 | 715 | //updating of the large image 716 | document.getElementById("large-image-input").addEventListener("change", () => { 717 | updatePreview("largeimg") 718 | }) 719 | 720 | document.getElementById("small-image-input").addEventListener("change", () => { 721 | updatePreview("smallimg") 722 | }) 723 | 724 | //fix win outline 725 | if (process.platform === "linux") { 726 | h1 = document.querySelectorAll("h1") 727 | h1.forEach((item, i, arr) => { 728 | item.setAttribute("style", "-webkit-text-stroke-width: 2px") 729 | }) 730 | } 731 | 732 | //make links open in new tab 733 | registerLinkToOpenInBrowser("github-button", "https://github.com/ThatOneCalculator/DiscordRPCMaker") 734 | registerLinkToOpenInBrowser("discord-button", "https://discord.com/invite/Z7UZPR3bbW") 735 | registerLinkToOpenInBrowser("web-button", "https://drpcm.t1c.dev") 736 | registerLinkToOpenInBrowser("donate-button", "https://buymeacoffee.com/that1calculator") 737 | 738 | //developer portal 739 | document.getElementById("devel").addEventListener("click", () => { 740 | notReady() 741 | develWindow = new BrowserWindow({ 742 | width: 1200, 743 | height: 700, 744 | webPreferences: { 745 | nodeIntegration: true, 746 | preload: `${__dirname}${slash}clientidDetect.js` 747 | } 748 | }); 749 | //load html into window 750 | develWindow.loadURL('https://discord.com/developers') 751 | // develWindow.webContents.openDevTools(); 752 | //garbage collection handle 753 | develWindow.on('close', function () { 754 | develWindow = null; 755 | }); 756 | }) 757 | 758 | settings = JSON.parse(fs.readFileSync(settingspath, 'utf8')) 759 | document.querySelector("#faqbody").innerHTML = fs.readFileSync(path.join(__dirname + `${slash}locales${slash}faq${slash}${settings['language']}.html`)) 760 | registerLinkToOpenInBrowser("cliutility", "https://github.com/ThatOneCalculator/DiscordRPCMaker-CLI") 761 | registerLinkToOpenInBrowser("t1c", "https://t1c.dev") 762 | registerLinkToOpenInBrowser("kraxen", "https://github.com/KraXen72") 763 | registerLinkToOpenInBrowser("mikey", "https://twitter.com/ChildishMigster") 764 | }) 765 | 766 | /*preview updating*/ 767 | function updatePreview(type) { 768 | notReady() 769 | //images 770 | let smallimage = document.getElementById("small-image-input") 771 | let largeimage = document.getElementById("large-image-input") 772 | let smallimageprev = document.getElementById("small-image") 773 | let largeimageprev = document.getElementById("large-image") 774 | //description 775 | let desc1 = document.getElementById("description-input-1") 776 | let desc2 = document.getElementById("description-input-2") 777 | //buttons 778 | let btn1name = document.getElementById("button1-input-name") 779 | let btn1url = document.getElementById("button1-input-url") 780 | let btn2name = document.getElementById("button2-input-name") 781 | let btn2url = document.getElementById("button2-input-url") 782 | 783 | if (type == "largeimg") { //large - if image from id not found, just put placeholder there 784 | let imgid = getImageIdFromName(largeimage.value) 785 | console.log(imgid) 786 | if (imgid == "") { 787 | largeimageprev.setAttribute("src", "assets/placeholder.png") 788 | document.getElementById("small-image-input").setAttribute("disabled", "") 789 | document.getElementById("small-image-div").classList.add("customdisabled") 790 | } else { 791 | largeimageprev.setAttribute("src", `https://cdn.discordapp.com/app-assets/${clientID}/${imgid}.png`) 792 | document.getElementById("small-image-input").removeAttribute("disabled") 793 | document.getElementById("small-image-div").classList.remove("customdisabled") 794 | } 795 | } else if (type == "smallimg") { //small - if image from id not found, just put placeholder there 796 | let imgid = getImageIdFromName(smallimage.value) 797 | console.log(imgid) 798 | if (imgid == "") { 799 | smallimageprev.setAttribute("src", "assets/blank.png") 800 | } else { 801 | smallimageprev.setAttribute("src", `https://cdn.discordapp.com/app-assets/${clientID}/${imgid}.png`) 802 | } 803 | } else if (type == "desc1") { //description line 1 804 | document.getElementById("preview-description-1").innerHTML = desc1.value 805 | } else if (type == "desc2") { //description line 2 806 | document.getElementById("preview-description-2").innerHTML = desc2.value 807 | } else if (type == "btn1name") { //button 1 name 808 | document.getElementById("preview-button-1").innerHTML = btn1name.value 809 | } else if (type == "btn1url") {// button 1 url 810 | updateValidButton(document.getElementById("preview-button-1"), btn1url) 811 | } else if (type == "btn2name") { //button 2 name 812 | document.getElementById("preview-button-2").innerHTML = btn2name.value 813 | } else if (type == "btn2url") {// button 2 url 814 | updateValidButton(document.getElementById("preview-button-2"), btn2url) 815 | } 816 | } 817 | 818 | /*utility functions*/ 819 | 820 | /** 821 | * register a button to open in the native browser 822 | * @param {String} elemid element id 823 | * @param {String} link the link to go to 824 | */ 825 | function registerLinkToOpenInBrowser(elemid, link) { 826 | let elem = document.querySelector(`#${elemid}`) 827 | 828 | elem.addEventListener("click", () => { 829 | shell.openExternal(link) 830 | }) 831 | 832 | faqbtn = document.getElementById("faq-button") 833 | faqbtn.addEventListener("click", () => { openFaqModal() }) 834 | faqbtn = document.getElementById("closefaqmodal") 835 | faqbtn.addEventListener("click", () => { closeFaqModal() }) 836 | settingsbtn = document.getElementById("settings-button") 837 | settingsbtn.addEventListener("click", () => { openSettingsModal() }) 838 | settingsbtn = document.getElementById("closesettingsmodal") 839 | settingsbtn.addEventListener("click", () => { closeSettingsModal() }) 840 | 841 | } 842 | 843 | //add a style to head - used when loading themes 844 | function addStyle(styleString) { 845 | const style = document.createElement('style'); 846 | style.textContent = styleString; 847 | document.head.append(style); 848 | } 849 | 850 | //url validation regex 851 | function validateurl(str) { 852 | const regexp = /^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/ 853 | 854 | return regexp.test(str) 855 | } 856 | function dec2hex(dec) { 857 | return dec.toString(16).padStart(2, "0") 858 | } 859 | 860 | function generateId(len) { 861 | let arr = new Uint8Array((len || 40) / 2) 862 | window.crypto.getRandomValues(arr) 863 | return Array.from(arr, dec2hex).join('') 864 | } 865 | 866 | //get the image id from options provided the name 867 | function getImageIdFromName(imgName) { 868 | let matchedid = "" 869 | options.forEach((image, i, arr) => { 870 | if (image.name == imgName) { 871 | matchedid = image.id 872 | } 873 | }) 874 | return matchedid 875 | } 876 | 877 | function notReady() { 878 | document.getElementById("test").setAttribute("disabled", "true") 879 | //console.log("not ready") 880 | } 881 | 882 | function removeAllChildNodes(parent) { 883 | while (parent.firstChild) { 884 | parent.removeChild(parent.firstChild); 885 | } 886 | } 887 | 888 | //presences loading and reloading 889 | 890 | function loadSavedPresences() { 891 | let files = fs.readdir(dir, (directory, files) => { 892 | console.log(files) 893 | let wrapper = document.getElementById('presence-scroller') 894 | files.forEach(file => { 895 | console.log(file) 896 | if (file.includes(".json") && file.includes("settings") == false) { 897 | let presence = JSON.parse(fs.readFileSync(dir + file, 'utf8')); 898 | let elem = document.createElement('div') 899 | html = ` 900 |
901 |
${presence.name}
902 |
File: ${file.replaceAll(".json", "")}
903 | 904 |
905 | ` 906 | elem.innerHTML = html 907 | wrapper.appendChild(elem) 908 | 909 | elem.querySelector('.presence-edit').addEventListener("click", () => { 910 | loadPresence(presence, file) 911 | }) 912 | } 913 | }) 914 | }) 915 | } 916 | 917 | function reloadPresences() { 918 | let wrapper = document.getElementById('presence-scroller') 919 | removeAllChildNodes(wrapper) 920 | loadSavedPresences() 921 | } 922 | 923 | /*faq and settings*/ 924 | function openFaqModal() { 925 | const modal = document.querySelector("#faqmodal") 926 | document.querySelector(".main-grid").classList.add("modal-open") 927 | modal.classList.add("open") 928 | document.querySelector(".preview-small-pic").style.visibility = "hidden" 929 | } 930 | 931 | function closeFaqModal() { 932 | const modal = document.querySelector("#faqmodal") 933 | modal.classList.remove("open") 934 | document.querySelector(".main-grid").classList.remove("modal-open") 935 | document.querySelector(".preview-small-pic").style.visibility = "visible" 936 | } 937 | 938 | function openSettingsModal() { 939 | const modal = document.querySelector("#settingsmodal") 940 | document.querySelector(".main-grid").classList.add("modal-open") 941 | modal.classList.add("open") 942 | document.querySelector(".preview-small-pic").style.visibility = "hidden" 943 | } 944 | 945 | function closeSettingsModal() { 946 | const modal = document.querySelector("#settingsmodal") 947 | modal.classList.remove("open") 948 | document.querySelector(".main-grid").classList.remove("modal-open") 949 | document.querySelector(".preview-small-pic").style.visibility = "visible" 950 | } 951 | 952 | //lang 953 | 954 | function loadLang(language) { 955 | 956 | //let lang = settings.language 957 | let source = `.${slash}locales${slash}${language}.json` 958 | let lang = JSON.parse(fs.readFileSync(source, 'utf8')) 959 | let keys = Object.keys(lang) 960 | 961 | console.log(lang, source) 962 | for (let i = 0; i < Object.keys(lang).length; i++) { 963 | const name = keys[i]; 964 | const item = lang[name]; 965 | 966 | try { 967 | document.querySelector(`.lang-${name}`).innerText = item 968 | if (document.querySelector(`.lang-${name}`).nodeName === "INPUT") { 969 | document.querySelector(`.lang-${name}`).setAttribute("placeholder", item) 970 | } 971 | } catch (e) { } 972 | 973 | //document.querySelector(`.lang-${name}`).innerText = item 974 | 975 | } 976 | } --------------------------------------------------------------------------------