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 98e551f commit f4f98cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 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.3'
version '2.0.4'

compileKotlin.kotlinOptions.jvmTarget = '1.8'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import me.dkim19375.dkim19375jdautils.util.getOfType
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent
import java.awt.Color

val OTHER_TYPE: CommandType = object : CommandType("OTHER", "Other") {}

@API
class HelpCommand(private val bot: BotBase) : Command(bot) {
override val command = "help"
Expand All @@ -23,7 +25,7 @@ class HelpCommand(private val bot: BotBase) : Command(bot) {
"View commands in the ${type.displayname.lowercase()} category"
)
}.toSet()
override val type = object : CommandType("OTHER", "Other") {}
override val type = OTHER_TYPE
override val minArgs = 1

override fun onGuildCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ object EmbedUtils {
}

private fun combineStrings(first: String, second: String): String {
return first + second
return "$first$second"
}

@API
fun getEmbedGroup(name: String, values: Collection<String>): MessageEmbed.Field {
if (values.isEmpty()) {
return MessageEmbed.Field(name, "```\nNone ```", false)
}
var value = "```\n- "
var i = 1
for (string in values) {
Expand All @@ -31,6 +34,6 @@ object EmbedUtils {
i++
}
value = combineStrings(value, "```")
return MessageEmbed.Field(name, value, true)
return MessageEmbed.Field(name, value, false)
}
}

0 comments on commit f4f98cf

Please sign in to comment.