diff --git a/src/main/kotlin/moe/nikky/ConfigurationExtension.kt b/src/main/kotlin/moe/nikky/ConfigurationExtension.kt index 532611a..f87db8c 100644 --- a/src/main/kotlin/moe/nikky/ConfigurationExtension.kt +++ b/src/main/kotlin/moe/nikky/ConfigurationExtension.kt @@ -26,7 +26,7 @@ import moe.nikky.checks.anyCheck import moe.nikky.checks.hasRoleNullable import net.peanuuutz.tomlkt.TomlComment import org.koin.dsl.module -import java.util.* +import java.util.Locale class ConfigurationExtension : Extension(), Klogging { override val name: String = "configuration-extension" diff --git a/src/main/kotlin/moe/nikky/DiceExtension.kt b/src/main/kotlin/moe/nikky/DiceExtension.kt index 248df6e..97a12e7 100644 --- a/src/main/kotlin/moe/nikky/DiceExtension.kt +++ b/src/main/kotlin/moe/nikky/DiceExtension.kt @@ -1,6 +1,10 @@ package moe.nikky -import br.com.colman.dicehelper.* +import br.com.colman.dicehelper.Dice +import br.com.colman.dicehelper.DiceNotation +import br.com.colman.dicehelper.FixedDice +import br.com.colman.dicehelper.RandomDice +import br.com.colman.dicehelper.diceNotation import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.converters.impl.string import com.kotlindiscord.kord.extensions.extensions.Extension diff --git a/src/main/kotlin/moe/nikky/Json5DataAdapter.kt b/src/main/kotlin/moe/nikky/Json5DataAdapter.kt index 1c96073..61d3854 100644 --- a/src/main/kotlin/moe/nikky/Json5DataAdapter.kt +++ b/src/main/kotlin/moe/nikky/Json5DataAdapter.kt @@ -7,7 +7,6 @@ import com.kotlindiscord.kord.extensions.storage.DataAdapter import com.kotlindiscord.kord.extensions.storage.StorageUnit import com.kotlindiscord.kord.extensions.storage.storageFileRoot import io.github.xn32.json5k.Json5 -import kotlinx.serialization.json.Json import java.io.File import java.nio.file.Path import kotlin.io.path.div diff --git a/src/main/kotlin/moe/nikky/Main.kt b/src/main/kotlin/moe/nikky/Main.kt index fc603a8..9f409e5 100644 --- a/src/main/kotlin/moe/nikky/Main.kt +++ b/src/main/kotlin/moe/nikky/Main.kt @@ -23,7 +23,7 @@ import org.koin.dsl.module import java.io.File import java.security.Security import java.text.SimpleDateFormat -import java.util.* +import java.util.Date private val logger = logger("moe.nikky.Main") val TEST_GUILD_ID = envOrNull("TEST_GUILD")?.let { Snowflake(it) } diff --git a/src/main/kotlin/moe/nikky/RoleChooserConfig.kt b/src/main/kotlin/moe/nikky/RoleChooserConfig.kt index 2f2b624..e0ab0a6 100644 --- a/src/main/kotlin/moe/nikky/RoleChooserConfig.kt +++ b/src/main/kotlin/moe/nikky/RoleChooserConfig.kt @@ -9,12 +9,10 @@ import dev.kord.core.entity.Message import dev.kord.core.entity.ReactionEmoji import dev.kord.core.entity.Role import dev.kord.core.entity.channel.TextChannel -import dev.kord.core.entity.channel.TopGuildMessageChannel import dev.kord.rest.request.KtorRequestException import io.github.xn32.json5k.SerialComment import io.klogging.context.logContext import io.klogging.logger -import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.withContext import kotlinx.serialization.Serializable diff --git a/src/main/kotlin/moe/nikky/RoleManagementExtension.kt b/src/main/kotlin/moe/nikky/RoleManagementExtension.kt index 0c64ad9..6992c62 100644 --- a/src/main/kotlin/moe/nikky/RoleManagementExtension.kt +++ b/src/main/kotlin/moe/nikky/RoleManagementExtension.kt @@ -1,14 +1,9 @@ package moe.nikky import com.kotlindiscord.kord.extensions.DiscordRelayedException -import com.kotlindiscord.kord.extensions.checks.anyGuild -import com.kotlindiscord.kord.extensions.checks.guildFor import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.CommandContext import com.kotlindiscord.kord.extensions.commands.application.slash.ephemeralSubCommand -import com.kotlindiscord.kord.extensions.commands.converters.impl.ColorConverter -import com.kotlindiscord.kord.extensions.commands.converters.impl.boolean -import com.kotlindiscord.kord.extensions.commands.converters.impl.color import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingBoolean import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalChannel import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalColor @@ -38,17 +33,12 @@ import dev.kord.core.behavior.MessageBehavior import dev.kord.core.behavior.channel.ChannelBehavior import dev.kord.core.behavior.channel.asChannelOf import dev.kord.core.behavior.channel.createMessage -import dev.kord.core.behavior.channel.editMemberPermission -import dev.kord.core.behavior.channel.editRolePermission import dev.kord.core.behavior.createRole import dev.kord.core.behavior.edit -import dev.kord.core.behavior.getChannelOfOrNull import dev.kord.core.entity.Guild import dev.kord.core.entity.Message import dev.kord.core.entity.ReactionEmoji import dev.kord.core.entity.Role -import dev.kord.core.entity.channel.GuildChannel -import dev.kord.core.entity.channel.NewsChannel import dev.kord.core.entity.channel.TextChannel import dev.kord.core.event.guild.GuildCreateEvent import dev.kord.core.live.live @@ -57,14 +47,11 @@ import dev.kord.core.live.onReactionRemove import dev.kord.rest.request.KtorRequestException import io.github.xn32.json5k.Json5 import io.klogging.Klogging -import io.klogging.context.logContext import kotlinx.coroutines.CoroutineName import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull -import kotlinx.coroutines.flow.first -import kotlinx.coroutines.flow.firstOrNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.toList import kotlinx.serialization.Serializable @@ -73,8 +60,7 @@ import kotlinx.serialization.builtins.serializer import moe.nikky.converter.reactionEmoji import org.koin.core.component.inject import org.koin.dsl.module -import java.lang.Exception -import java.util.* +import java.util.Locale class RoleManagementExtension : Extension(), Klogging { override val name: String = "role-management" diff --git a/src/main/kotlin/moe/nikky/TestExtension.kt b/src/main/kotlin/moe/nikky/TestExtension.kt index c5fc054..2b8f94f 100644 --- a/src/main/kotlin/moe/nikky/TestExtension.kt +++ b/src/main/kotlin/moe/nikky/TestExtension.kt @@ -4,8 +4,15 @@ import com.kotlindiscord.kord.extensions.commands.Arguments import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.optionalEnumChoice import com.kotlindiscord.kord.extensions.commands.application.slash.ephemeralSubCommand -import com.kotlindiscord.kord.extensions.commands.converters.impl.* -import com.kotlindiscord.kord.extensions.extensions.* +import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalDuration +import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalString +import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalUser +import com.kotlindiscord.kord.extensions.commands.converters.impl.string +import com.kotlindiscord.kord.extensions.commands.converters.impl.user +import com.kotlindiscord.kord.extensions.extensions.Extension +import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand +import com.kotlindiscord.kord.extensions.extensions.event +import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand import com.kotlindiscord.kord.extensions.utils.respond import dev.kord.common.entity.GuildScheduledEventEntityMetadata import dev.kord.common.entity.GuildScheduledEventPrivacyLevel diff --git a/src/main/kotlin/moe/nikky/json/VersiondSerializer.kt b/src/main/kotlin/moe/nikky/json/VersiondSerializer.kt index d0fab72..bd1fcb3 100644 --- a/src/main/kotlin/moe/nikky/json/VersiondSerializer.kt +++ b/src/main/kotlin/moe/nikky/json/VersiondSerializer.kt @@ -3,7 +3,14 @@ package moe.nikky.json import io.klogging.Klogging import kotlinx.coroutines.runBlocking import kotlinx.serialization.KSerializer -import kotlinx.serialization.json.* +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.JsonTransformingSerializer +import kotlinx.serialization.json.intOrNull +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive import moe.nikky.debugF data class VersionMigrator( diff --git a/src/main/kotlin/moe/nikky/toDuration.kt b/src/main/kotlin/moe/nikky/toDuration.kt index 1b0d44d..41b0cd4 100644 --- a/src/main/kotlin/moe/nikky/toDuration.kt +++ b/src/main/kotlin/moe/nikky/toDuration.kt @@ -1,6 +1,10 @@ package moe.nikky -import kotlinx.datetime.* +import kotlinx.datetime.Clock +import kotlinx.datetime.DateTimePeriod +import kotlinx.datetime.Instant +import kotlinx.datetime.TimeZone +import kotlinx.datetime.plus import kotlin.time.Duration /** diff --git a/src/main/kotlin/moe/nikky/twitch/TwitchApi.kt b/src/main/kotlin/moe/nikky/twitch/TwitchApi.kt index 5113919..a9ff003 100644 --- a/src/main/kotlin/moe/nikky/twitch/TwitchApi.kt +++ b/src/main/kotlin/moe/nikky/twitch/TwitchApi.kt @@ -6,10 +6,15 @@ import io.ktor.client.* import io.ktor.client.call.* import io.ktor.client.plugins.* import io.ktor.client.request.* -import io.sentry.JsonSerializable import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.* +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.asFlow +import kotlinx.coroutines.flow.distinctUntilChanged +import kotlinx.coroutines.flow.emptyFlow +import kotlinx.coroutines.flow.flatMapConcat +import kotlinx.coroutines.flow.flow +import kotlinx.coroutines.flow.map import kotlinx.datetime.Clock import kotlinx.datetime.Instant import kotlinx.serialization.KSerializer @@ -18,7 +23,12 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.SerializationException import kotlinx.serialization.Transient import kotlinx.serialization.builtins.ListSerializer -import kotlinx.serialization.json.* +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.JsonArray +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonNull +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.jsonPrimitive import moe.nikky.debugF import moe.nikky.errorF import moe.nikky.infoF diff --git a/src/main/kotlin/moe/nikky/twitch/TwitchEntryConfig.kt b/src/main/kotlin/moe/nikky/twitch/TwitchEntryConfig.kt index 5c2f384..cbf4cc1 100644 --- a/src/main/kotlin/moe/nikky/twitch/TwitchEntryConfig.kt +++ b/src/main/kotlin/moe/nikky/twitch/TwitchEntryConfig.kt @@ -3,7 +3,6 @@ package moe.nikky.twitch import com.kotlindiscord.kord.extensions.storage.Data import dev.kord.common.entity.Snowflake import kotlinx.serialization.Serializable -import net.peanuuutz.tomlkt.TomlBlockArray import net.peanuuutz.tomlkt.TomlComment @Serializable diff --git a/src/main/kotlin/moe/nikky/twitch/TwitchExtension.kt b/src/main/kotlin/moe/nikky/twitch/TwitchExtension.kt index 1336ef5..e94caff 100644 --- a/src/main/kotlin/moe/nikky/twitch/TwitchExtension.kt +++ b/src/main/kotlin/moe/nikky/twitch/TwitchExtension.kt @@ -45,9 +45,7 @@ import dev.kord.core.entity.channel.TextChannel import dev.kord.core.entity.channel.TopGuildMessageChannel import dev.kord.rest.Image import dev.kord.rest.builder.message.EmbedBuilder -import dev.kord.rest.builder.message.create.embed import dev.kord.rest.builder.message.embed -import dev.kord.rest.builder.message.modify.embed import dev.kord.rest.request.KtorRequestException import dev.kord.rest.request.RestRequestException import io.klogging.Klogging