cleanup

fun MessageAction.cleanup(delay: Long = 3): RestAction<Void>

Cleanup a bot message that was sent.

Return

a RestAction

Samples

import dev.jaims.kda.channel.send
import dev.jaims.kda.message.cleanup
import net.dv8tion.jda.api.entities.Message
import net.dv8tion.jda.api.entities.TextChannel
fun main() { 
   //sampleStart 
   val x: Long = 5
// send a message and then delete it after x seconds
channel.send(message).cleanup(x).queue() 
   //sampleEnd
}

Parameters

delay

the delay in seconds before deleting