aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/com/romangraef/jdacommander/ICommand.kt
diff options
context:
space:
mode:
authorRoman Gräf <romangraef@loves.dicksinhisan.us>2020-08-21 19:11:42 +0200
committerRoman Gräf <romangraef@loves.dicksinhisan.us>2020-08-21 19:11:42 +0200
commit69f28613499e3ce418326d05c66e5c856acb8269 (patch)
tree01376f981dce3b44918389860b6eabed92bf9ba1 /src/main/kotlin/com/romangraef/jdacommander/ICommand.kt
downloaddiscord-jda-jcommander-master.tar.gz
discord-jda-jcommander-master.tar.bz2
discord-jda-jcommander-master.zip
Initial commitHEADmaster
Diffstat (limited to 'src/main/kotlin/com/romangraef/jdacommander/ICommand.kt')
-rw-r--r--src/main/kotlin/com/romangraef/jdacommander/ICommand.kt14
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)
+}