Skip to content

Commit

Permalink
Added the ability to respond to interactions.
Browse files Browse the repository at this point in the history
Removed the hard coded limit of embeds for webhooks.
Fixed a bug where interactions from DM's throw an error.
  • Loading branch information
felldo committed May 17, 2021
1 parent 37a1fe4 commit 8fc9c37
Show file tree
Hide file tree
Showing 18 changed files with 1,004 additions and 126 deletions.
@@ -0,0 +1,55 @@
package org.javacord.api.entity.message;

/**
* Represents a message flag type.
*/
public enum Flag {

/**
* An ephemeral message (only visible for the user).
*/
EPHEMERAL(64),

/**
* An unknown flag.
*/
UNKNOWN(-1);

/**
* The id of the flag.
*/
private final int id;

/**
* Creates a new message flag type.
*
* @param id The id of the type.
*/
Flag(int id) {
this.id = id;
}

/**
* Gets the id of the message flag type.
*
* @return The id of the message flag type.
*/
public int getId() {
return id;
}

/**
* Gets the message flag type by its id.
*
* @param id The id of the message flag type.
* @return The message flag type with the given id or {@link Flag#UNKNOWN} if unknown id.
*/
public static Flag getFlagTypeById(int id) {
switch (id) {
case 64:
return EPHEMERAL;
default:
return UNKNOWN;
}
}
}

0 comments on commit 8fc9c37

Please sign in to comment.