Package org.javacord.api.entity
Interface Deletable
-
- All Known Subinterfaces:
ChannelCategory,IncomingWebhook,Invite,KnownCustomEmoji,Message,RegularServerChannel,RichInvite,Role,Server,ServerChannel,ServerForumChannel,ServerStageVoiceChannel,ServerTextChannel,ServerThreadChannel,ServerVoiceChannel,Sticker,UnknownRegularServerChannel,UnknownServerChannel,Webhook
public interface DeletableAn entity that can be deleted.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.concurrent.CompletableFuture<java.lang.Void>delete()Deletes the entity.java.util.concurrent.CompletableFuture<java.lang.Void>delete(java.lang.String reason)Deletes the entity.default java.util.concurrent.CompletableFuture<java.lang.Void>deleteAfter(long duration, java.util.concurrent.TimeUnit unit)Deletes the entity after the given time.default java.util.concurrent.CompletableFuture<java.lang.Void>deleteAfter(long duration, java.util.concurrent.TimeUnit unit, java.lang.String auditLogReason)Deletes the entity after the given time.default java.util.concurrent.CompletableFuture<java.lang.Void>deleteAfter(java.time.Duration duration)Deletes the entity after the given time.default java.util.concurrent.CompletableFuture<java.lang.Void>deleteAfter(java.time.Duration duration, java.lang.String auditLogReason)Deletes the entity after the given time.DiscordApigetApi()Gets the DiscordApi managing this entity.
-
-
-
Method Detail
-
getApi
DiscordApi getApi()
Gets the DiscordApi managing this entity.- Returns:
- The api instance.
-
delete
default java.util.concurrent.CompletableFuture<java.lang.Void> delete()
Deletes the entity.- Returns:
- A future to tell if the deletion was successful.
-
delete
java.util.concurrent.CompletableFuture<java.lang.Void> delete(java.lang.String reason)
Deletes the entity.- Parameters:
reason- The audit log reason for the deletion.- Returns:
- A future to tell if the deletion was successful.
-
deleteAfter
default java.util.concurrent.CompletableFuture<java.lang.Void> deleteAfter(long duration, java.util.concurrent.TimeUnit unit)Deletes the entity after the given time.Caution: If the bot shuts down before the scheduled time, the entity will not be deleted.
- Parameters:
duration- The duration.unit- The unit for the duration.- Returns:
- A future that completes when the entity has been deleted.
-
deleteAfter
default java.util.concurrent.CompletableFuture<java.lang.Void> deleteAfter(long duration, java.util.concurrent.TimeUnit unit, java.lang.String auditLogReason)Deletes the entity after the given time.Caution: If the bot shuts down before the scheduled time, the entity will not be deleted.
- Parameters:
duration- The duration.unit- The unit for the duration.auditLogReason- The reason to log for the audit log.- Returns:
- A future that completes when the entity has been deleted.
-
deleteAfter
default java.util.concurrent.CompletableFuture<java.lang.Void> deleteAfter(java.time.Duration duration)
Deletes the entity after the given time.Caution: If the bot shuts down before the scheduled time, the entity will not be deleted.
- Parameters:
duration- The duration.- Returns:
- A future that completes when the entity has been deleted.
-
deleteAfter
default java.util.concurrent.CompletableFuture<java.lang.Void> deleteAfter(java.time.Duration duration, java.lang.String auditLogReason)Deletes the entity after the given time.Caution: If the bot shuts down before the scheduled time, the entity will not be deleted.
- Parameters:
duration- The duration.auditLogReason- The reason to log for the audit log.- Returns:
- A future that completes when the entity has been deleted.
-
-