Coder Social home page Coder Social logo

Comments (7)

freya022 avatar freya022 commented on June 6, 2024

Please provide code example for reproduction steps, I have no idea what getEmbeds method you're talking about, nor where the message comes from

If I had to guess, this is a message received event, in which case the embed resolution is done asynchronously (on Discord's side), as you may have noticed that embeds sometimes do take time to appear on Discord itself, it is therefore not a JDA issue.

There's also an event that fires when an embed get resolved, see MessageEmbedEvent

from jda.

Erdragh avatar Erdragh commented on June 6, 2024

Sorry, I'm indeed talking about the message received event. I've also just found the line where they're parsed so I was about to say that it seems it's a problem on Discord's side:

final List<MessageEmbed> embeds = map(jsonObject, "embeds", this::createMessageEmbed);

Is there a way to check whether a message has any embeds, even if they aren't resolved yet? I'm constrained by needing the entire contents of a message and any embeds it may have at a singular point in time, so if I could check whether a message has embeds and then wait for them I would like to know about it. From what I've read in the wiki and javadocs so far, it doesn't seem like it.

from jda.

freya022 avatar freya022 commented on June 6, 2024

There's no way to determine if a message will have embeds generated by links, only Discord's embed generator can do that.

You can check if a message has links, you should be able to find a few regex's online

Telling why you need to see generated embeds would also help

from jda.

Erdragh avatar Erdragh commented on June 6, 2024

(I've updated the issue with the relevant code now)

My usecase is synchronizing Discord chat with Minecraft chat, where I want to send the Discord messages into the Minecraft chat after formatting them with Minecraft's Component system. In the code example given in the issue you can see where I access the embeds and format them.

from jda.

Erdragh avatar Erdragh commented on June 6, 2024

Also, not every link leads to an embed, so checking whether there's a link and then waiting for the embeds event may just deadlock the program if done without a timeout. I want it to be as responsive as possible.

from jda.

freya022 avatar freya022 commented on June 6, 2024

If there's no way to edit a MC message to include the embeds later, then you can't

from jda.

Erdragh avatar Erdragh commented on June 6, 2024

Alright, there isn't. This answers my question. Thanks for your time.

from jda.

Related Issues (20)

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.