send

fun MessageChannel.send(message: Message): MessageAction

Send a Message.

Return

a MessageAction

Samples

import dev.jaims.kda.channel.purge
import dev.jaims.kda.channel.send
import dev.jaims.kda.message.buildEmbed
import dev.jaims.kda.message.cleanup
import net.dv8tion.jda.api.entities.MessageChannel
import net.dv8tion.jda.api.entities.TextChannel
import net.dv8tion.jda.api.entities.User
fun main() { 
   //sampleStart 
   // send a message and clean it up
channel.send(buildEmbed { setDescription("This is my embed!") }).cleanup().queue()

// send a message
textChannel.send("This is an example!").queue()

// purge a channel with a custom predicate
textChannel.purge { it.author != someUser && !it.isPinned } 
   //sampleEnd
}

Parameters

message

the message to send

fun MessageChannel.send(content: String): MessageAction

Send a Message as just a string in the MessageChannel. No fancy embed or anything else.

Return

a MessageAction

Samples

import dev.jaims.kda.channel.purge
import dev.jaims.kda.channel.send
import dev.jaims.kda.message.buildEmbed
import dev.jaims.kda.message.cleanup
import net.dv8tion.jda.api.entities.MessageChannel
import net.dv8tion.jda.api.entities.TextChannel
import net.dv8tion.jda.api.entities.User
fun main() { 
   //sampleStart 
   // send a message and clean it up
channel.send(buildEmbed { setDescription("This is my embed!") }).cleanup().queue()

// send a message
textChannel.send("This is an example!").queue()

// purge a channel with a custom predicate
textChannel.purge { it.author != someUser && !it.isPinned } 
   //sampleEnd
}

Parameters

content

the message to send

fun MessageChannel.send(embed: MessageEmbed): MessageAction

Send a Message to a channel with only a MessageEmbed

Return

a MessageAction

Samples

import dev.jaims.kda.channel.purge
import dev.jaims.kda.channel.send
import dev.jaims.kda.message.buildEmbed
import dev.jaims.kda.message.cleanup
import net.dv8tion.jda.api.entities.MessageChannel
import net.dv8tion.jda.api.entities.TextChannel
import net.dv8tion.jda.api.entities.User
fun main() { 
   //sampleStart 
   // send a message and clean it up
channel.send(buildEmbed { setDescription("This is my embed!") }).cleanup().queue()

// send a message
textChannel.send("This is an example!").queue()

// purge a channel with a custom predicate
textChannel.purge { it.author != someUser && !it.isPinned } 
   //sampleEnd
}

Parameters

embed

the embed to send