diff options
Diffstat (limited to 'src/main/kotlin/com/romangraef/jdacommander/ICommand.kt')
-rw-r--r-- | src/main/kotlin/com/romangraef/jdacommander/ICommand.kt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/kotlin/com/romangraef/jdacommander/ICommand.kt b/src/main/kotlin/com/romangraef/jdacommander/ICommand.kt new file mode 100644 index 0000000..99fee95 --- /dev/null +++ b/src/main/kotlin/com/romangraef/jdacommander/ICommand.kt @@ -0,0 +1,14 @@ +package com.romangraef.jdacommander + +import net.dv8tion.jda.api.entities.Message +import net.dv8tion.jda.api.entities.MessageChannel +import net.dv8tion.jda.api.requests.RestAction + +abstract class ICommand { + lateinit var base: BaseInformation + lateinit var message: Message + abstract fun run() + val channel get() = message.channel + val jda get() = message.jda + val responseChannel: RestAction<out MessageChannel> get() = if (base.sendToDM) message.author.openPrivateChannel() else SyncRestAction(jda, channel) +} |