18 lines
586 B
Kotlin
18 lines
586 B
Kotlin
package nl.voidcorp.ottobot.command
|
|
|
|
import net.dv8tion.jda.api.entities.Guild
|
|
import nl.voidcorp.ottobot.database.GuildStore
|
|
import nl.voidcorp.ottobot.database.GuildStores
|
|
import org.jetbrains.exposed.sql.transactions.transaction
|
|
|
|
object CommandSettings {
|
|
fun getPrefix(guild: Guild): String {
|
|
return transaction { GuildStore.find { GuildStores.guildId eq guild.idLong }.firstOrNull()?.prefix } ?: "?"
|
|
}
|
|
|
|
fun setPrefix(guild: Guild, prefix: String) {
|
|
transaction { GuildStore.find { GuildStores.guildId eq guild.idLong }.first().prefix = prefix }
|
|
}
|
|
}
|
|
|