diff --git a/EssentialsDiscord/src/main/java/net/essentialsx/api/v2/services/discord/InteractionRole.java b/EssentialsDiscord/src/main/java/net/essentialsx/api/v2/services/discord/InteractionRole.java index 982369258..006973463 100644 --- a/EssentialsDiscord/src/main/java/net/essentialsx/api/v2/services/discord/InteractionRole.java +++ b/EssentialsDiscord/src/main/java/net/essentialsx/api/v2/services/discord/InteractionRole.java @@ -10,6 +10,12 @@ public interface InteractionRole { */ String getName(); + /** + * Gets the mention of this role. + * @return this role's mention. + */ + String getAsMention(); + /** * Whether this role is managed by an external integration. * @return true if the role is managed. @@ -34,6 +40,12 @@ public interface InteractionRole { */ boolean isDefaultColor(); + /** + * Whether this role can be given to other members by the current logged in bot. + * @return true if this role can be interacted with by the current bot user. + */ + boolean canInteract(); + /** * Gets the ID of this role. * @return this role's ID. diff --git a/EssentialsDiscord/src/main/java/net/essentialsx/discord/interactions/InteractionRoleImpl.java b/EssentialsDiscord/src/main/java/net/essentialsx/discord/interactions/InteractionRoleImpl.java index bec62cdbf..545caad5e 100644 --- a/EssentialsDiscord/src/main/java/net/essentialsx/discord/interactions/InteractionRoleImpl.java +++ b/EssentialsDiscord/src/main/java/net/essentialsx/discord/interactions/InteractionRoleImpl.java @@ -15,6 +15,11 @@ public class InteractionRoleImpl implements InteractionRole { return role.getName(); } + @Override + public String getAsMention() { + return role.getAsMention(); + } + @Override public boolean isManaged() { return role.isManaged(); @@ -35,6 +40,11 @@ public class InteractionRoleImpl implements InteractionRole { return role.getColorRaw() == Role.DEFAULT_COLOR_RAW; } + @Override + public boolean canInteract() { + return role.getGuild().getSelfMember().canInteract(role); + } + public Role getJdaObject() { return role; } @@ -43,4 +53,9 @@ public class InteractionRoleImpl implements InteractionRole { public String getId() { return role.getId(); } + + @Override + public String toString() { + return "InteractionRoleImpl{name=" + getName() + ",id=" + getId() + "}"; + } }