Skip to content

Commit

Permalink
fix a few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dkim19375 committed May 14, 2021
1 parent 457d9cc commit 98e551f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding 'UTF-8'

group 'me.dkim19375'
version '2.0.2'
version '2.0.3'

compileKotlin.kotlinOptions.jvmTarget = '1.8'

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/me/dkim19375/dkim19375jdautils/BotBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import kotlin.system.exitProcess

@API
abstract class BotBase(
val name: String,
@API val token: String,
val customListener: CustomListener = object : CustomListener() {}
open val name: String,
open val token: String,
open val customListener: CustomListener = object : CustomListener() {}
) {
@API
lateinit var jda: JDA
Expand Down Expand Up @@ -71,5 +71,5 @@ abstract class BotBase(
}
}

fun sendEvent(event: (Command) -> Unit) = commands.forEach(event)
open fun sendEvent(event: (Command) -> Unit) = commands.forEach(event)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import net.dv8tion.jda.api.events.message.priv.PrivateMessageReceivedEvent

abstract class CustomListener {
@API
val antiBot: Boolean = true
open val antiBot: Boolean = true

@API
fun onMessageReceived(event: MessageReceivedEvent): Boolean = true
open fun onMessageReceived(event: MessageReceivedEvent): Boolean = true
@API
fun onGuildMessageReceived(event: GuildMessageReceivedEvent): Boolean = true
open fun onGuildMessageReceived(event: GuildMessageReceivedEvent): Boolean = true
@API
fun onPrivateMessageReceived(event: PrivateMessageReceivedEvent): Boolean = true
open fun onPrivateMessageReceived(event: PrivateMessageReceivedEvent): Boolean = true
@API
fun isValid(
open fun isValid(
command: Command,
cmd: String,
args: List<String>,
Expand Down Expand Up @@ -65,15 +65,15 @@ abstract class CustomListener {
}
return true
}
fun isValid(
open fun isValid(
command: Command,
cmd: String,
args: List<String>,
event: GuildMessageReceivedEvent
): Boolean =
isValid(command, cmd, args, event.member, event.author, event.guild, event.message, event.channel, event)

fun isValid(
open fun isValid(
command: Command,
cmd: String,
args: List<String>,
Expand All @@ -86,7 +86,7 @@ abstract class CustomListener {
}, event.message, event.channel, event
)

fun isValid(
open fun isValid(
command: Command,
cmd: String,
args: List<String>,
Expand Down

0 comments on commit 98e551f

Please sign in to comment.