Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to respond to interactions.
Removed the hard coded limit of embeds for webhooks. Fixed a bug where interactions from DM's throw an error.
- Loading branch information
Showing
18 changed files
with
1,004 additions
and
126 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
javacord-api/src/main/java/org/javacord/api/entity/message/Flag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
Oops, something went wrong.