MinnDevelopment/discord-webhooks

Embed Issue

LoicMaitreDuFeu opened this issue · 8 comments

it seems that Icon of an EmbedAuthor and EmbedFooter doesn't work properly.
image

I tried many types of image of URL, it still doesn't work.
image

Did you make sure the url is a valid image url?
It afaik needs to have a valid file extension (i.e. https://example.com/image.png)

Yes, you would also notice the event.getGuild().getIconUrl() for the Footer, which doesn't work aswell.

For the author. It seems right.
The main image of the Embed is from the same url kind, and there are 3 images in the "message1"
image

Can you show me your build.gradle / pom.xml?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>iecompbot</groupId>
    <artifactId>Inazuma-Competitive</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <repositories>
        <repository>
            <id>jcenter</id>
            <name>jcenter-bintray</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
        <repository>
            <id>dv8tion</id>
            <name>m2-dv8tion</name>
            <url>https://m2.dv8tion.net/releases</url>
        </repository>
        <repository>
            <id>jitpack</id>
            <name>jitpack</name>
            <url>https://jitpack.io/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.sedmelluq</groupId>
            <artifactId>lavaplayer</artifactId>
            <version>1.3.77</version> <!-- Replace with the latest version -->
        </dependency>
        <dependency>
            <groupId>net.dv8tion</groupId>
            <artifactId>JDA</artifactId>
            <version>5.0.0-beta.17</version>
        </dependency>
        <dependency>
            <groupId>com.vdurmont</groupId>
            <artifactId>emoji-java</artifactId>
            <version>5.1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.12.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.MinnDevelopment</groupId>
            <artifactId>discord-webhooks</artifactId>
            <version>345fd27</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.33</version>
        </dependency>
        <dependency>
            <groupId>ie.inazuma.utilities</groupId>
            <artifactId>InazumaUtilities</artifactId>
            <version>1.0-0</version>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>5.12.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>at.stefangeyer.challonge</groupId>
            <artifactId>core</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>at.stefangeyer.challonge.serializer</groupId>
            <artifactId>gson</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>at.stefangeyer.challonge.rest</groupId>
            <artifactId>retrofit</artifactId>
            <version>2.1.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>14</source>
                    <target>14</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                            <mainClass>iecompbot.Main</mainClass> <!-- You have to replace this with a path to your main class like my.path.Main -->
                        </transformer>
                    </transformers>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

It looks like your dependency configuration pulls in an outdated version of org.json. I would recommend trying to resolve dependency conflicts[1,2,3] and make sure that the correct version is used (ideally the most recent).

  1. Maven dependency resolution (conflicted)
  2. Maven Dependency Tree - Resolving Conflicts
  3. Conflicting library version in a Java Maven project

If you mean also use the latest version of this dependency, I cannot as I use the Components feature from a PR using jitpack.

No, an outdated version of a transitive dependency, org.json.

Cleaned up the dependencies and imported org.json, solved the issue, Thanks !