简体   繁体   中英

Custom emoji on react? JDA

How can I get custom emojis from my server? Not per unicode?

package de.backxtar.listener;

import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;

public class ReactMessageListener extends ListenerAdapter {

    public void onGuildMessageReceived(GuildMessageReceivedEvent event){

        if(event.getChannel().getId().equals("635352238256029706")) {
            event.getMessage().addReaction("U+1F44D").complete();
            event.getMessage().addReaction("U+1F44E").complete();
        }
    }
}

This function is working with unicode emojis.. but I want to react with my custom emojis ..

The documentation has an example that outlines how to use the method. You can use a custom emoji by passing "name:id" . To get the id of a custom emoji, send it to some discord channel with backslash infront of the emoji: \\:name: . This will render it in the raw mention format <:name:id> which contains the id and name you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM