refactor: Move stuff around
This commit is contained in:
parent
c901eb2f66
commit
690812b628
1 changed files with 9 additions and 2 deletions
|
@ -4,11 +4,18 @@ import dev.kord.core.behavior.channel.createMessage
|
|||
import dev.kord.core.entity.Message
|
||||
import dev.kord.rest.builder.message.AllowedMentionsBuilder
|
||||
import dev.kord.rest.builder.message.allowedMentions
|
||||
import io.github.null2264.tsukumogami.core.commands.CommandHolder
|
||||
|
||||
class Context(private val bot: AbstractBot, private val message: Message, val prefix: String?, private val commandAndArguments: List<String>?) {
|
||||
class Context(
|
||||
private val bot: AbstractBot,
|
||||
private val message: Message,
|
||||
val prefix: String?,
|
||||
commandAndArguments: List<String>?,
|
||||
) {
|
||||
|
||||
val author get() = message.author
|
||||
val command get() = commandAndArguments?.get(0)?.let { bot.getCommand(it) }
|
||||
val commandAndArguments: MutableList<String>? = commandAndArguments?.toMutableList()
|
||||
val command: CommandHolder? = this.commandAndArguments?.removeAt(0)?.let { bot.getCommand(it) }
|
||||
|
||||
suspend fun send(content: String) = message.channel.createMessage(content)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue