Comments (15)
Doesn't seem to be working on Linux either.
Uncaught Error: Could not call remote method 'setIcon'. Check that the method signature is correct. Underlying error: Error processing argument at index 0, conversion failure from /usr/share/icons/hicolor48x48/apps/steam.png
Underlying stack: TypeError: Error processing argument at index 0, conversion failure from /usr/share/icons/hicolor48x48/apps/steam.png
at /opt/discord-ptb/resources/electron.asar/browser/rpc-server.js:370:67
at EventEmitter.<anonymous> (/opt/discord-ptb/resources/electron.asar/browser/rpc-server.js:249:27)
at EventEmitter.emit (events.js:200:13)
at WebContents.<anonymous> (/opt/discord-ptb/resources/electron.asar/browser/api/web-contents.js:342:29)
at WebContents.emit (events.js:200:13)
at /opt/discord-ptb/resources/electron.asar/browser/rpc-server.js:373:21
at EventEmitter.<anonymous> (/opt/discord-ptb/resources/electron.asar/browser/rpc-server.js:249:27)
at EventEmitter.emit (events.js:200:13)
at WebContents.<anonymous> (/opt/discord-ptb/resources/electron.asar/browser/api/web-contents.js:342:29)
at WebContents.emit (events.js:200:13)
from khub.
Can you confirm that the PNG is actually a PNG and not a different format hiding in a PNG file?
from khub.
Yes, it's a PNG.
/usr/share/icons/hicolor/48x48/apps/steam.png: PNG image data, 48 x 48, 8-bit/color RGBA, non-interlaced
I noticed that the path in the error log is missing a slash even though it's there in the input field. 🤔
from khub.
While I try to figure out exactly why that slash is not there, could you try adding an extra slash where the single one is?
from khub.
No error. Still not working.
from khub.
This is strange, I can even use this path on my Windows system.
/Users/Name/Desktop/discord.png
from khub.
Try this version and tell me what path it prints in the console.
CustomDiscordIcon.prototype.getSettingsPanel = function() {
var settingsWrapper = document.createElement("div");
settingsWrapper.setAttribute("style", "width; 100%; height: auto;");
// Here is the toggle for using the guild and DM icons.
// Checked = valueChecked-m-4IJZ
// Unchecked = valueUnchecked-2lU_20
var useGuildIcon = document.createElement("div");
useGuildIcon.setAttribute("id", "useGuildIcon");
var useGuildIconText = document.createElement("div");
useGuildIconText.setAttribute("id", "useGuildIconText");
var useGuildIconInput = document.createElement("input");
useGuildIconInput.setAttribute("id", "useGuildIconInput");
useGuildIcon.setAttribute("class", "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueUnchecked-2lU_20 value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX");
useGuildIcon.setAttribute("tabindex", "0");
useGuildIcon.setAttribute("style", "flex: 0 0 auto; width: 250px; margin-bottom: 10px;");
useGuildIcon.onclick = () => {
if (useGuildIcon.getAttribute("class") == "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX") {
useGuildIcon.setAttribute("class", "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueUnchecked-2lU_20 value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX");
useGuildIconInput.setAttribute("checked", "false");
} else {
useGuildIcon.setAttribute("class", "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX");
useGuildIconInput.setAttribute("checked", "true");
}
saveSettings();
};
// Make sure that the checkbox is set to the correct value when it is created.
if (loadSettings().useGuildIcons) {
useGuildIcon.setAttribute("class", "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueChecked-m-4IJZ value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX");
useGuildIconInput.setAttribute("checked", "true");
} else {
useGuildIcon.setAttribute("class", "flexChild-faoVW3 da-flexChild switchEnabled-V2WDBB switch-3wwwcV da-switchEnabled da-switch valueUnchecked-2lU_20 value-2hFrkk sizeDefault-2YlOZr size-3rFEHg themeDefault-24hCdX");
useGuildIconInput.setAttribute("checked", "false");
}
useGuildIconText.innerHTML = "Use Guild & DM Icons";
useGuildIconText.setAttribute("style", "position: absolute; text-align: center; width: 100%; height: 100%; line-height: 22.5px;");
useGuildIconInput.setAttribute("class", "checkboxEnabled-CtinEn checkbox-2tyjJg da-checkboxEnabled da-checkbox");
useGuildIconInput.setAttribute("type", "checkbox");
useGuildIconInput.setAttribute("tabindex", "-1");
useGuildIconInput.setAttribute("checked", "false");
useGuildIconInput.setAttribute("style", "margin-left: auto; margin-right: auto;");
useGuildIcon.appendChild(useGuildIconText);
useGuildIcon.appendChild(useGuildIconInput);
var iconPath = document.createElement("input");
iconPath.setAttribute("id", "custom-icon-path");
iconPath.setAttribute("placeholder", "Enter the path to the image.");
iconPath.setAttribute("type", "text");
iconPath.setAttribute("style", "width: 100%; height: 30px; border-width: 0px; border-radius: 10px; background-color: rgba(255, 255, 255, 0.7); padding-left: 10px; margin-bottom: 10px;");
var errorHTML = "<br>Your image must use a standard format such as <strong>PNG or JPG</strong>.<br>Animated GIFs are not supported and never will be.<br>Your image can't be a URL to something online, it has to ba saved somewhere.";
iconPath.oninput = () => {
saveSettings();
try {
console.log(document.getElementById("custom-icon-path").value);
win.setIcon(document.getElementById("custom-icon-path").value);
removeError();
} catch (e) {
settingsWrapper.appendChild(createError(errorHTML));
}
};
var title = document.createElement("h1");
title.setAttribute("style", "font-size: 1.5em; margin-bottom: 20px;");
title.innerHTML = `<strong>CustomDiscordIcon Settings</strong>`;
settingsWrapper.appendChild(title);
settingsWrapper.appendChild(useGuildIcon);
settingsWrapper.appendChild(iconPath);
iconPath.value = (loadSettings() == undefined ? "" : loadSettings().customImagePath);
// Try setting the icon right away.
setTimeout(() => {
try {
console.log(document.getElementById("custom-icon-path").value);
win.setIcon(document.getElementById("custom-icon-path").value);
removeError();
} catch (e) {
settingsWrapper.appendChild(createError(errorHTML));
}
}, 100);
BdApi.showToast("CustomDiscordIcon: Your settings will be saved automatically.", {});
return settingsWrapper;
};
from khub.
You could have posted a patch instead of the entire file.
from khub.
I changed it, just replace the getSettingsPanel
function.
from khub.
Nothing in the logs. This is in the config file.
{
"useGuildIcons": false,
"customImagePath": "/usr/share/icons/hicolor/48x48/apps/steam.png"
}
Switching useGuildIcon
to true, I get the same error but the path is /home/$USER/.config/BetterDiscord/plugins/icon.png
. Normally, you should be saving this file in a temporary directory:
path.join(os.tmpdir(), 'CustomDiscordIcon.png')
from khub.
Anyway, my guess is you simply can't modify the icon on Linux because it either uses a file from Discord's directory, or a file provided by the system's icon theme. Both of which are normally owned by root
.
from khub.
That's possible, but it doesn't explain why the slash was missing from the path earlier.
I'll need more Linux users to confirm.
from khub.
Yeah, I don't know about that one. ¯\_(ツ)_/¯
from khub.
I don't know what else to say, but as a linux user, I can confirm it does not work.
I am running Ubuntu 18.04 on Unity desktop environment
from khub.
Hello, I do not understand how to change the photo of Discord, can you help me? (I am on Windows so no problem)
from khub.
Related Issues (20)
- CustomDiscordIcon - Discord Source - [Issue Report] HOT 1
- [SafeEmbedGenerator] Why can't you send rich embeds? HOT 2
- [DarkDarkTheme] Server Folders aren't themed HOT 4
- [DarkDarkTheme] Cut Off Discord Icon HOT 7
- AntiGhostPing overlay does not cover entire window HOT 1
- [SafeEmbedGenerator] Missing button. HOT 2
- [AutoJoinInvites] Plugin Request HOT 1
- AntiGhostPing (rus) if you need) HOT 1
- [SafeEmbedGenerator] HOT 5
- [GhostMessage] HOT 4
- Nickcord theme no longer working
- [GhostMessage] HOT 1
- GhostMessage customizable delay HOT 1
- [GhostMessage] Not working HOT 1
- [SafeEmbedGenerator] Not Working HOT 4
- [GhostMessage] Not Working HOT 5
- [GhostMessage] HOT 2
- [SafeEmbedGenerator] Plugin not working despite having the required library installed HOT 1
- [AntiGhostPing] No longer working HOT 5
- [GhostMessage] TypeError: Cannot read property 'currentChannel' of undefined
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from khub.