Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

jda embed message

// Create the EmbedBuilder instance
EmbedBuilder eb = new EmbedBuilder();

/*
    Set the title:
    1. Arg: title as string
    2. Arg: URL as string or could also be null
 */
eb.setTitle("Title", null);

/*
    Set the color
 */
eb.setColor(Color.red);
eb.setColor(new Color(0xF40C0C));
eb.setColor(new Color(255, 0, 54));

/*
    Set the text of the Embed:
    Arg: text as string
 */
eb.setDescription("Text");

/*
    Add fields to embed:
    1. Arg: title as string
    2. Arg: text as string
    3. Arg: inline mode true / false
 */
eb.addField("Title of field", "test of field", false);

/*
    Add spacer like field
    Arg: inline mode true / false
 */
eb.addBlankField(false);

/*
    Add embed author:
    1. Arg: name as string
    2. Arg: url as string (can be null)
    3. Arg: icon url as string (can be null)
 */
eb.setAuthor("name", null, "https://github.com/zekroTJA/DiscordBot/blob/master/.websrc/zekroBot_Logo_-_round_small.png");

/*
    Set footer:
    1. Arg: text as string
    2. icon url as string (can be null)
 */
eb.setFooter("Text", "https://github.com/zekroTJA/DiscordBot/blob/master/.websrc/zekroBot_Logo_-_round_small.png");

/*
    Set image:
    Arg: image url as string
 */
eb.setImage("https://github.com/zekroTJA/DiscordBot/blob/master/.websrc/logo%20-%20title.png");

/*
    Set thumbnail image:
    Arg: image url as string
 */
eb.setThumbnail("https://github.com/zekroTJA/DiscordBot/blob/master/.websrc/logo%20-%20title.png");

//You need to build it to a string with ".build()" or it wont work.
channel.sendMessage(eb.build()).queue();
Comment

PREVIOUS NEXT
Code Example
Java :: Update UI on main thread Android 
Java :: how to get the dimensions of a 2d array in java 
Java :: close scanner java 
Java :: PlatformException (PlatformException(error, Neither user 10024 nor current process has android.permission.WAKE_LOCK., null, java.lang.SecurityException: Neither user 10024 nor current process has android.permission.WAKE_LOCK. 
Java :: how to check if a char is equal to int java 
Java :: check the string has spaces in it in java 
Java :: all combinations of well-formed parentheses 
Java :: how to add java_home in mac 
Java :: display image from database in java servlet 
Java :: android studio get string 
Java :: leetcode patterns 
Java :: spring enable cors 
Java :: Unable to find bundled Java version. 
Java :: android send parameters with intent 
Java :: java random string 
Java :: java program to find perimeter of rectangle 
Java :: print line in jjava 
Java :: into to string in java 
Java :: date java format 
Java :: java hashmap for loop 
Java :: java swing alert window 
Java :: counting sort java 
Java :: java gui 
Java :: eval in java 
Java :: shell sort java 
Java :: how to wait in java 
Java :: java localtime format 
Java :: how to initialise array in java without size 
Java :: get first letter of string in array java 
Java :: java loop hashmap 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =