I use a script to add text to the embed pickaxes message area when an image is clicked but after clicking or pressing enter it opens the Pickaxe but shows blank.
Idea behind this is the same as icebreakers in Pickaxe.
Note - If press space or add other text by hand it works normally, but in any case I add no text or spaces I simply get blank. I even tried “clicking”, “pressing enter” and “bubble” through code but nothing worked against this bug.
Here is the script:
<script>
document.addEventListener('DOMContentLoaded', function() {
const textMappings = {
"imageID": "Test message"
};
Object.keys(textMappings).forEach(id => {
const element = document.getElementById(id);
if (element) {
element.addEventListener("click", () => {
const textarea = document.querySelector("textarea");
if (textarea) {
// Tried clicking to see if this would have fixed the bug
textarea.click();
textarea.focus();
textarea.value += (textarea.value ? " " : "") + textMappings[id];
textarea.scrollTop = textarea.scrollHeight;
}
});
}
});
});
</script>
Any help regarding this issue is highly appreciated.
This falls a bit outside the behavior we can provide support for, because it’s more or less custom.
The code you have looks like it could work, though I’d make some adjustments.
I’d change querySelector to querySelectorAll, because you might end up with multiple text areas. I’d also be very careful about the order of the script in relation to our script, this should probably come after.
Yes, the code is placed below your script and is set to run within DOMContentLoaded to ensure it executes only after your code has loaded.
I want to clarify that my code is functioning as expected. The issue lies with the bot. When text is added to the bot’s text field using my script, the bot doesn’t seem to recognize it as text. Instead, it treats it as “empty.”
The question remains: what is causing the bot to behave this way? Why is it unable to process the text added programmatically? This behavior doesn’t seem logical.