public final class Ban extends Object implements DiscordObject
Constructor and Description |
---|
Ban(GatewayDiscordClient gateway,
discord4j.discordjson.json.BanData data)
Constructs a
Ban with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
GatewayDiscordClient |
getClient()
Returns the
GatewayDiscordClient that created this object. |
Optional<String> |
getReason()
Gets the reason for the ban.
|
User |
getUser()
Gets the banned user.
|
String |
toString() |
public Ban(GatewayDiscordClient gateway, discord4j.discordjson.json.BanData data)
Ban
with an associated ServiceMediator and Discord data.gateway
- The GatewayDiscordClient
associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.public GatewayDiscordClient getClient()
DiscordObject
GatewayDiscordClient
that created this object. Methods in it are exclusively based on the
entity cache or Store
in use. Refer to calling getClient().rest()
to access a
DiscordClient
that is capable of requesting entities directly from the REST API.getClient
in interface DiscordObject
GatewayDiscordClient
associated to this object.public Optional<String> getReason()
public User getUser()