Code Monkey home page Code Monkey logo

glitchii / embedbuilder Goto Github PK

View Code? Open in Web Editor NEW
240.0 240.0 84.0 4.7 MB

A Discord embed builder with both a GUI and JSON editor to use with Discord bots, webhooks, and other applications

Home Page: https://glitchii.github.io/embedbuilder/

License: MIT License

CSS 14.94% JavaScript 71.53% HTML 13.53%
discord discord-embed discord-embed-builder discord-json discord-json-embed discord-webhook embed embed-builder embed-builder-discord embed-visualizer webhook

embedbuilder's People

Contributors

cayeoficial avatar glitchii avatar manhbi18112005 avatar nobu-sh avatar rock583 avatar x1xo avatar zignis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

embedbuilder's Issues

currentURL is not a function

Getting TypeError: currentURL is not a function when Auto-update URL options (if this is checked will get the error on window load) and Auto-update data link URL are checked.

Request Failed

After choose photo from button Browse
Show me error : Request Failed (Check Dev-Tool)
What That?

ReferenceError: hljs is not defined

Error: ReferenceError: hljs is not defined
Found at: Bottom of the page. Fired by:

error = (msg, time) => {
            notif.innerHTML = msg, notif.style.display = 'block';
            time && setTimeout(() => notif.animate({ opacity: '0', bottom: '-50px', offset: 1 }, { easing: 'ease', duration: 500 })
                .onfinish = () => notif.style.removeProperty('display'), time);
            return false;
        }

At lines 96 - 101


Reproduction Steps:

  • Clone repo
  • Run index.js

didnt work with express and ejs

idk wtf is wrong with the code so that it wont show correctly on my bot dashboard?
it works fine when i open it with live server
Screenshot_2022-06-11_13-09-03
Screenshot_2022-06-11_13-09-37
Screenshot_2022-06-11_13-10-15
Screenshot_2022-06-11_13-10-40

Annoying behaviour of Title field

When editing the Title field, then collapsing or expanding another field and going back to the Title field, it collapses. so you have to expand it again to edit it. I guess this is because the Title field can't really expand and therefore the editing field and the expanding/collapsing hitbox overlap, leading to this behaviour.

Would appreciate a fix, really like the builder!

Editing a field creates a new object with Grammarly

When editing an existing field, a new value object is created. A simple fix to this is to make minor changes to the index.js file. At line 454, replace

let jsonField = json.embed.fields[Array.from(fields.children).indexOf(field)];

with

let jsonField = json.embed.fields[Array.from(fields.children).indexOf(field)-2];

Source: Invalid array index

Edit:
-2 isn't a permanent / efficient fix, the extension was messing up with the textarea

Iframe doesn't work

The problem is that if I try to implement the code as a iframe to my website, I get this error below.
image

?data= parameter breaks utf8

This is my data parameter:
JTdCJTIyY29udGVudCUyMjolMjIlMjIsJTIyZW1iZWRzJTIyOiU1QiU3QiUyMnRpdGxlJTIyOiUyMioqU3RyZWFrJTIwemVyc3QlQzMlQjZydCEqKiUyMiwlMjJ0eXBlJTIyOiUyMnJpY2glMjIsJTIyZGVzY3JpcHRpb24lMjI6JTIyRGllJTIwJTNDIzg2MDg5MzM4NzY0NTY0ODkwNiUzRSUyMFN0cmVhayUyMHd1cmRlJTIwZ2Vicm9jaGVuOiU1Q25FcndhcnRldGUlMjBaYWhsOiUyMDE0JTVDbklucHV0JTIwdm9uJTIwJTNDQDk4MDQzNzQyOTI1NTMwNzMxNCUzRTolMjAxJTIyLCUyMmNvbG9yJTIyOjE2NzExNjgwLCUyMmZvb3RlciUyMjolN0IlMjJ0ZXh0JTIyOiUyMlNvbGx0ZSUyMGRlciUyMEVpbmRydWNrJTIwZW50c3RlaGVuLCUyMGRhcyUyMGRpZSUyMFN0cmVhayUyMGFic2ljaHRsaWNoJTIwemVyc3QlQzMlQjZydCUyMHd1cmRlJTIwdW5kJTIwZXMlMjBuaWNodCUyMGRhcyUyMGVyc3RlJTIwbWFsJTIwaXN0LCUyMGJpdHRlJTIwZW50c3ByZWNoZW5kZSUyME1hJUMzJTlGbmFobWVuJTIwZXJncmVpZmVuKHouQiUyMEF1c3NjaGx1c3MlMjB2b20lMjBDaGFubmVsKSElMjIlN0QlN0QlNUQlN0Q=

It was first URLEncoded and then hashed with base64.
When I manually reverse the process, everything works as it should. But when I open the url with the data parameter some characters break(Ü, Ö, ß etc., see below)
image

Question

This is a nice integration, but can you make it that you can press a button and paste a webhook url in and send it to a channel instand?

Feature Request: Edit Embeds Already Posted

Like the title says. I would love to replace CarlBot as all I use it for is embeds. CarlBot has commands to edit embeds it has posted such as.
embedsource <msg_ID> [channel]
then running ecembed <msg_ID> <JSON/Pastebin_Link/Starb.in_Link>
to edit the updated embed if this could be done in the editor even better but I would settle for commands :D

Indent Display

If you use the '>' indentation on your embed builder with more than one line it disposes of all but the first line.

Example to reproduce:
In a single embed field on your builder type the following.

test 1
test 2

Only test 1 will show in the preview.

Tested on Chromium based browser.

Add limits info

Embeds have some limits:

  • Title is limited to 256 characters
  • Description is limited to 4096 characters
  • An embed can contain a maximum of 25 fields
  • A field name/title is limited to 256 character and the value of the field is limited to 1024 characters
  • Footer is limited to 2048 characters
  • Author name is limited to 256 characters
  • The total of characters allowed in an embed is 6000

It would be helpful to add some (maybe toggle show/hide) character counters and field counters. While text already stops when you hit the character count limit, and you already get an error message when trying to add a 26th field, etc. knowing how close you are to hitting the cap can be helpful. The overall 6000 character limit is especially tough to add up as you're developing an embed.

Preview Issue

If you don't provide any guiTabs in the builder.config.js, the preview of the embed is broken. If you add in the assets/js/script.js on line 962 a if statement if there are any values inside the tabs array, you can prevent this.

E.g:

if (tabs.length) {
    for (const e of document.querySelectorAll(\`.${tabs.join(', .')}\`))  e.classList.add('active');
}

Delete embed properties which are set to "" or empty array

Discord's api now doesn't support parsing of json embeds with empty properties like this:
{"embed":{"title":"","description":"Hello! This won't work because title is empty and thumbnail url too!","color":4321431,"thumbnail":{"url":""}}}

So, I suggest to delete the property instead of letting it be "" (or empty array in case of fields), because discord doesn't support this now and this only causes problems.
It will look like this: {"embed":{"description":"Yay! No empty properties, now it works!","color":4321431}}

Same thing for content

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.