Search code examples
javadiscorddiscord-jda

Discord JDA add custom Emotes on GuildJoin


I have a .png image which I want to use as a emote. Is there a way to add this image to the server as an emote? I think this should be done in the GuildJoinEvent.

Thanks for your answers!


Solution

  • If I understand you correctly, you'd like to add a custom emote as soon as your bot joins a server. To achieve that, you could do something like the following in the GuildJoinEvent:

    Icon icon = Icon.from(new File("image.png"));
    event.getGuild().createEmote("MyEmoteName", icon).queue();