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 aBan
with an associatedGatewayDiscordClient
and Discord data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GatewayDiscordClient
getClient()
Returns theGatewayDiscordClient
that created this object.discord4j.discordjson.json.BanData
getData()
Gets the data of the ban.Optional<String>
getReason()
Gets the reason for the ban.User
getUser()
Gets the banned user.String
toString()
-
-
-
Constructor Detail
-
Ban
public Ban(GatewayDiscordClient gateway, discord4j.discordjson.json.BanData data)
Constructs aBan
with an associatedGatewayDiscordClient
and Discord data.- Parameters:
gateway
- TheGatewayDiscordClient
associated 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:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated 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.
-
-