Package discord4j.core.object
Class Ban
- java.lang.Object
-
- discord4j.core.object.Ban
-
- All Implemented Interfaces:
DiscordObject
public final class Ban extends Object implements DiscordObject
A Discord ban.- See Also:
- Ban Object
-
-
Constructor Summary
Constructors Constructor Description Ban(GatewayDiscordClient gateway, discord4j.discordjson.json.BanData data)Constructs aBanwith an associatedGatewayDiscordClientand Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClientgetClient()Returns theGatewayDiscordClientthat created this object.discord4j.discordjson.json.BanDatagetData()Gets the data of the ban.Optional<String>getReason()Gets the reason for the ban.UsergetUser()Gets the banned user.StringtoString()
-
-
-
Constructor Detail
-
Ban
public Ban(GatewayDiscordClient gateway, discord4j.discordjson.json.BanData data)
Constructs aBanwith an associatedGatewayDiscordClientand Discord data.- Parameters:
gateway- TheGatewayDiscordClientassociated to this object, must be non-null.data- The raw data as represented by Discord, must be non-null.
-
-
Method Detail
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObjectReturns theGatewayDiscordClientthat created this object. Methods in it are exclusively based on the entity cache orStorein use. Refer to callinggetClient().rest()to access aDiscordClientthat is capable of requesting entities directly from the REST API.- Specified by:
getClientin interfaceDiscordObject- Returns:
- The
GatewayDiscordClientassociated to this object.
-
getData
public discord4j.discordjson.json.BanData getData()
Gets the data of the ban.- Returns:
- The data of the ban.
-
getReason
public Optional<String> getReason()
Gets the reason for the ban.- Returns:
- The reason for the ban.
-
getUser
public User getUser()
Gets the banned user.- Returns:
- The banned user.
-
-