Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Sep 25, 2024
1 parent 17ec83f commit 61206ea
Show file tree
Hide file tree
Showing 58 changed files with 32 additions and 64 deletions.
1 change: 0 additions & 1 deletion common/src/commonMain/kotlin/entity/Snowflake.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.common.entity

import dev.kord.common.entity.Snowflake.Companion.validValues
import kotlinx.datetime.Clock
import kotlinx.datetime.Instant
import kotlinx.serialization.KSerializer
Expand Down
1 change: 0 additions & 1 deletion common/src/commonTest/kotlin/entity/MessageFlagTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.common.entity

import dev.kord.ksp.Generate.EntityType.INT_FLAGS
import kotlin.random.Random
import kotlin.random.nextInt
import kotlin.test.Test
Expand Down
1 change: 0 additions & 1 deletion common/src/commonTest/kotlin/entity/PermissionTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.common.entity

import dev.kord.ksp.Generate.EntityType.BIT_SET_FLAGS
import kotlin.random.Random
import kotlin.random.nextInt
import kotlin.test.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.common.entity.optional

import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.test.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.common.entity.optional

import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.test.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.common.entity.optional

import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.test.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dev.kord.common.entity.optional
import dev.kord.common.entity.Snowflake
import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.test.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.common.entity.optional

import kotlinx.serialization.Serializable
import kotlinx.serialization.SerializationException
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.test.Test
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonTest/kotlin/json/ChannelTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import dev.kord.common.readFile
import kotlinx.coroutines.test.runTest
import kotlinx.serialization.json.Json
import kotlin.js.JsName
import kotlin.time.Duration.Companion.seconds
import kotlin.test.Test
import kotlin.time.Duration.Companion.seconds

private suspend fun file(name: String): String = readFile("channel", name)

Expand Down
3 changes: 1 addition & 2 deletions common/src/jvmTest/kotlin/ColorTestsJvm.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package dev.kord.common

import kotlin.test.assertEquals

import kotlin.test.Test
import kotlin.test.assertEquals

class ColorTestsJvm {
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import io.ktor.client.*
import io.ktor.client.request.*
import io.ktor.client.request.forms.*
import io.ktor.client.statement.*
import io.ktor.content.*
import io.ktor.http.*
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.SupervisorJob
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/behavior/GuildEmojiBehavior.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package dev.kord.core.behavior
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.cache.data.EmojiData
import dev.kord.core.entity.KordEntity
import dev.kord.core.entity.GuildEmoji
import dev.kord.core.entity.KordEntity
import dev.kord.core.entity.Strategizable
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
Expand Down
3 changes: 1 addition & 2 deletions core/src/commonMain/kotlin/behavior/MessageBehavior.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.core.behavior

import dev.kord.common.entity.Permission
import dev.kord.common.entity.Snowflake
import dev.kord.common.exception.RequestException
import dev.kord.core.Kord
Expand All @@ -10,6 +9,7 @@ import dev.kord.core.cache.data.MessageData
import dev.kord.core.entity.*
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.core.supplier.getChannelOf
Expand All @@ -20,7 +20,6 @@ import dev.kord.rest.builder.message.modify.WebhookMessageModifyBuilder
import dev.kord.rest.request.RestRequestException
import dev.kord.rest.service.RestClient
import kotlinx.coroutines.flow.Flow
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/behavior/TemplateBehavior.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import dev.kord.core.KordObject
import dev.kord.core.cache.data.toData
import dev.kord.core.entity.Guild
import dev.kord.core.entity.Template
import dev.kord.core.hash
import dev.kord.rest.builder.template.GuildFromTemplateCreateBuilder
import dev.kord.rest.builder.template.GuildTemplateModifyBuilder
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/behavior/UserBehavior.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import dev.kord.core.entity.*
import dev.kord.core.entity.channel.Channel
import dev.kord.core.entity.channel.DmChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.json.JsonErrorCode
import dev.kord.rest.json.request.DMCreateRequest
import dev.kord.rest.request.RestRequestException
import dev.kord.rest.service.RestClient
import io.ktor.http.*
import dev.kord.core.hash

/**
* The behavior of a [Discord User](https://discord.com/developers/docs/resources/user)
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/behavior/WebhookBehavior.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import dev.kord.core.entity.Message
import dev.kord.core.entity.Strategizable
import dev.kord.core.entity.Webhook
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.message.create.WebhookMessageCreateBuilder
import dev.kord.rest.builder.webhook.WebhookModifyBuilder
import dev.kord.rest.request.RestRequestException
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import dev.kord.core.entity.InviteWithMetadata
import dev.kord.core.entity.Webhook
import dev.kord.core.entity.channel.CategorizableChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.channel.InviteCreateBuilder
Expand All @@ -17,7 +18,6 @@ import dev.kord.rest.request.RestRequestException
import dev.kord.rest.service.RestClient
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import dev.kord.core.entity.KordEntity
import dev.kord.core.entity.Strategizable
import dev.kord.core.entity.channel.Channel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.core.supplier.getChannelOf
import dev.kord.core.supplier.getChannelOfOrNull
import dev.kord.rest.request.RestRequestException
import dev.kord.core.hash

/**
* The behavior of a [Discord Channel](https://discord.com/developers/docs/resources/channel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import dev.kord.core.entity.Strategizable
import dev.kord.core.entity.channel.GuildChannel
import dev.kord.core.entity.channel.TopGuildChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.core.hash

/**
* The behavior of a Discord channel associated to a [guild].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.message.EmbedBuilder
import dev.kord.rest.builder.message.create.MessageCreateBuilder
import dev.kord.rest.builder.message.create.UserMessageCreateBuilder
import dev.kord.rest.builder.message.embed
import dev.kord.rest.request.RestRequestException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.kord.core.behavior.channel

import dev.kord.common.entity.ChannelType
import dev.kord.common.entity.Permission
import dev.kord.common.entity.Snowflake
import dev.kord.common.exception.RequestException
import dev.kord.core.Kord
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import dev.kord.core.Kord
import dev.kord.core.entity.PermissionOverwrite
import dev.kord.core.entity.channel.TopGuildChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.channel.ChannelPermissionModifyBuilder
Expand All @@ -14,7 +15,6 @@ import dev.kord.rest.service.editMemberPermissions
import dev.kord.rest.service.editRolePermission
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.withIndex
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import dev.kord.core.cache.data.ChannelData
import dev.kord.core.entity.channel.Channel
import dev.kord.core.entity.channel.VoiceChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.channel.VoiceChannelModifyBuilder
import dev.kord.rest.request.RestRequestException
import dev.kord.rest.service.patchVoiceChannel
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import dev.kord.core.entity.channel.Channel
import dev.kord.core.entity.channel.ThreadParentChannel
import dev.kord.core.entity.channel.thread.ThreadChannel
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.channel.thread.StartThreadWithMessageBuilder
import dev.kord.rest.builder.channel.thread.StartThreadBuilder
import dev.kord.rest.builder.channel.thread.StartThreadWithMessageBuilder
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
import kotlinx.datetime.Instant
import dev.kord.core.hash

/**
* Behavior of channels that can contain public threads.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.kord.core.behavior.interaction

import dev.kord.common.annotation.KordUnsafe
import dev.kord.common.entity.MessageFlag
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.response.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.core.behavior.interaction

import dev.kord.common.entity.MessageFlag
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.response.EphemeralMessageInteractionResponseBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.core.behavior.interaction.response

import dev.kord.common.entity.MessageFlag
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.ActionInteractionBehavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.core.behavior.interaction.response

import dev.kord.common.entity.MessageFlag
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.core.behavior.interaction.response

import dev.kord.common.entity.MessageFlag
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.interaction.InteractionBehavior
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.core.builder.kord

import dev.kord.common.annotation.KordExperimental
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord

/**
* The proxy Kord builder. You probably want to invoke the [DSL builder][Kord.proxy] instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.core.builder.kord

import dev.kord.common.annotation.KordExperimental
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord

/**
* The rest only Kord builder. You probably want to invoke the [DSL builder][Kord.restOnly] instead.
Expand Down
2 changes: 0 additions & 2 deletions core/src/commonMain/kotlin/cache/data/ApplicationData.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import dev.kord.common.entity.*
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalSnowflake
import dev.kord.common.entity.optional.map
import dev.kord.common.entity.optional.mapNullable
import dev.kord.common.entity.optional.mapSnowflake
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

public sealed interface BaseApplicationData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.core.cache.data

import dev.kord.common.entity.DiscordInteractionMetadata
import dev.kord.common.entity.DiscordMessageInteraction
import dev.kord.common.entity.DiscordUser
import dev.kord.common.entity.IntegrationOwners
import dev.kord.common.entity.InteractionType
import dev.kord.common.entity.Snowflake
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package dev.kord.core.cache.data

import dev.kord.common.entity.Overwrite
import dev.kord.common.entity.*
import dev.kord.common.entity.Overwrite
import kotlinx.serialization.Serializable

@Serializable
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/entity/Emoji.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import dev.kord.core.behavior.MemberBehavior
import dev.kord.core.behavior.RoleBehavior
import dev.kord.core.behavior.UserBehavior
import dev.kord.core.cache.data.EmojiData
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.guild.EmojiModifyBuilder
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.filter
import dev.kord.core.hash
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract

Expand Down
1 change: 0 additions & 1 deletion core/src/commonMain/kotlin/entity/Integration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.kord.core.entity

import dev.kord.common.entity.IntegrationExpireBehavior
import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.optional.value
import dev.kord.common.exception.RequestException
import dev.kord.core.Kord
import dev.kord.core.behavior.GuildBehavior
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/entity/Member.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import dev.kord.core.behavior.UserBehavior
import dev.kord.core.cache.data.MemberData
import dev.kord.core.cache.data.UserData
import dev.kord.core.entity.interaction.GuildInteraction
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import kotlinx.coroutines.flow.*
import kotlinx.datetime.Instant
import dev.kord.core.hash

/**
* An instance of a [Discord Member](https://discord.com/developers/docs/resources/guild#guild-member-object).
Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/entity/Role.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import dev.kord.common.entity.optional.unwrap
import dev.kord.core.Kord
import dev.kord.core.behavior.RoleBehavior
import dev.kord.core.cache.data.RoleData
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.core.hash

public data class Role(
val data: RoleData,
Expand Down
Loading

0 comments on commit 61206ea

Please sign in to comment.