Skip to content

Commit

Permalink
Bump DeprecationLevels after 0.14.0 (#944)
Browse files Browse the repository at this point in the history
WARNING -> ERROR
ERROR -> HIDDEN
HIDDEN -> remove
  • Loading branch information
lukellmann authored May 27, 2024
1 parent d382224 commit a7f64b9
Show file tree
Hide file tree
Showing 31 changed files with 79 additions and 337 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,9 @@ public class Permissions internal constructor(
}

public companion object {
@Suppress(names = arrayOf("DEPRECATION"))
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
Expand All @@ -629,6 +630,7 @@ public class Permissions internal constructor(
}

@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
replaceWith = ReplaceWith(expression = "Permissions.Companion", imports =
arrayOf("dev.kord.common.entity.Permissions")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,9 @@ public class SystemChannelFlags internal constructor(
}

public companion object {
@Suppress(names = arrayOf("DEPRECATION"))
@Suppress(names = arrayOf("DEPRECATION_ERROR"))
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
Expand All @@ -339,6 +340,7 @@ public class SystemChannelFlags internal constructor(
}

@Deprecated(
level = DeprecationLevel.ERROR,
message = "Renamed to 'Companion'.",
replaceWith = ReplaceWith(expression = "SystemChannelFlags.Companion", imports =
arrayOf("dev.kord.common.entity.SystemChannelFlags")),
Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/DiscordBitSet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,6 @@ public fun DiscordBitSet(value: String): DiscordBitSet {
@Deprecated(
"Replaced by 'DiscordBitSet.serializer()'.",
ReplaceWith("DiscordBitSet.serializer()", imports = ["dev.kord.common.DiscordBitSet"]),
DeprecationLevel.ERROR,
DeprecationLevel.HIDDEN,
)
public object DiscordBitSetSerializer : KSerializer<DiscordBitSet> by DiscordBitSet.Serializer
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/Locale.kt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public data class Locale(val language: String, val country: String? = null) {
@Deprecated(
"Replaced by 'Locale.serializer()'.",
ReplaceWith("Locale.serializer()", imports = ["dev.kord.common.Locale"]),
DeprecationLevel.ERROR,
DeprecationLevel.HIDDEN,
)
public object Serializer : KSerializer<Locale> by NewSerializer

Expand Down
2 changes: 1 addition & 1 deletion common/src/commonMain/kotlin/entity/DiscordChannel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public sealed class ArchiveDuration(
@Deprecated(
"Replaced by 'ArchiveDuration.from()'.",
ReplaceWith("ArchiveDuration.from(duration)", imports = ["dev.kord.common.entity.ArchiveDuration"]),
DeprecationLevel.ERROR,
DeprecationLevel.HIDDEN,
)
public constructor(duration: Duration) : this(duration, unused = null)
}
Expand Down
6 changes: 3 additions & 3 deletions common/src/commonMain/kotlin/entity/DiscordShard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public data class DiscordShard(val index: Int, val count: Int) {
}

public companion object {
@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"Renamed to 'Companion'.",
ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]),
DeprecationLevel.WARNING,
DeprecationLevel.ERROR,
)
@JvmField
public val NewCompanion: NewCompanion = NewCompanion()
Expand All @@ -46,7 +46,7 @@ public data class DiscordShard(val index: Int, val count: Int) {
@Deprecated(
"Renamed to 'Companion'.",
ReplaceWith("DiscordShard.Companion", imports = ["dev.kord.common.entity.DiscordShard"]),
DeprecationLevel.WARNING,
DeprecationLevel.ERROR,
)
public class NewCompanion internal constructor() {
public fun serializer(): KSerializer<DiscordShard> = DiscordShard.serializer()
Expand Down
4 changes: 2 additions & 2 deletions common/src/commonMain/kotlin/entity/Permissions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ private val ALL_PERMISSIONS = Permissions(flags = Permission.entries)
/** All known [Permission]s (as contained in [Permission.entries]) combined into a single [Permissions] instance. */
public val Permissions.Companion.ALL: Permissions get() = ALL_PERMISSIONS

@Suppress("UnusedReceiverParameter", "DEPRECATION")
@Suppress("UnusedReceiverParameter", "DEPRECATION_ERROR")
@Deprecated(
"'Permissions.NewCompanion' was renamed to 'Permissions.Companion'. Use 'Permissions.Companion.ALL' instead.",
ReplaceWith("Permissions.ALL", imports = ["dev.kord.common.entity.Permissions", "dev.kord.common.entity.ALL"]),
DeprecationLevel.WARNING,
DeprecationLevel.ERROR,
)
public val Permissions.NewCompanion.ALL: Permissions get() = ALL_PERMISSIONS
2 changes: 1 addition & 1 deletion core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public final class dev/kord/core/Kord$Companion {
public final class dev/kord/core/KordKt {
public static final fun Kord (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun Kord$default (Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun getKordLogger ()Lmu/KLogger;
public static final synthetic fun getKordLogger ()Lmu/KLogger;
public static final fun logCaughtThrowable (Ljava/lang/Throwable;)V
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/commonMain/kotlin/Kord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.channels.Channel as CoroutineChannel

@Deprecated("Use your own logger instead, this will be removed in the future.", level = DeprecationLevel.ERROR)
@Deprecated("Use your own logger instead, this will be removed in the future.", level = DeprecationLevel.HIDDEN)
public val kordLogger: mu.KLogger = mu.KotlinLogging.logger { }

private val logger = KotlinLogging.logger { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import dev.kord.core.event.Event
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandCreateEvent : Event {
public val command: GuildApplicationCommand
}

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandCreateEvent(
override val command: GuildChatInputCommand,
Expand All @@ -28,11 +28,11 @@ public class ChatInputCommandCreateEvent(
) : ApplicationCommandCreateEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UserCommandCreateEvent(
override val command: GuildUserCommand,
Expand All @@ -42,11 +42,11 @@ public class UserCommandCreateEvent(
) : ApplicationCommandCreateEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class MessageCommandCreateEvent(
override val command: GuildMessageCommand,
Expand All @@ -56,11 +56,11 @@ public class MessageCommandCreateEvent(
) : ApplicationCommandCreateEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandCreateEvent(
override val command: UnknownGuildApplicationCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import dev.kord.core.event.Event
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandDeleteEvent : Event {
public val command: GuildApplicationCommand
}

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandDeleteEvent(
override val command: GuildChatInputCommand,
Expand All @@ -28,11 +28,11 @@ public class ChatInputCommandDeleteEvent(
) : ApplicationCommandDeleteEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UserCommandDeleteEvent(
override val command: GuildUserCommand,
Expand All @@ -42,11 +42,11 @@ public class UserCommandDeleteEvent(
) : ApplicationCommandDeleteEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class MessageCommandDeleteEvent(
override val command: GuildMessageCommand,
Expand All @@ -56,11 +56,11 @@ public class MessageCommandDeleteEvent(
) : ApplicationCommandDeleteEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandDeleteEvent(
override val command: UnknownGuildApplicationCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import dev.kord.core.event.Event
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public sealed interface ApplicationCommandUpdateEvent : Event {
public val command: GuildApplicationCommand
}

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class ChatInputCommandUpdateEvent(
override val command: GuildChatInputCommand,
Expand All @@ -28,11 +28,11 @@ public class ChatInputCommandUpdateEvent(
) : ApplicationCommandUpdateEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UserCommandUpdateEvent(
override val command: GuildUserCommand,
Expand All @@ -42,11 +42,11 @@ public class UserCommandUpdateEvent(
) : ApplicationCommandUpdateEvent


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class MessageCommandUpdateEvent(
override val command: GuildMessageCommand,
Expand All @@ -55,11 +55,11 @@ public class MessageCommandUpdateEvent(
override val customContext: Any?,
) : ApplicationCommandUpdateEvent

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
@Deprecated(
"This event is not supposed to be sent to bots. See https://github.com/discord/discord-api-docs/issues/3690 for " +
"details.",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
)
public class UnknownApplicationCommandUpdateEvent(
override val command: UnknownGuildApplicationCommand,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import dev.kord.core.event.Event as CoreEvent

internal class InteractionEventHandler : BaseGatewayEventHandler() {

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
override suspend fun handle(event: Event, shard: Int, kord: Kord, context: LazyContext?): CoreEvent? =
when (event) {
is InteractionCreate -> handle(event, shard, kord, context)
Expand Down Expand Up @@ -54,7 +54,7 @@ internal class InteractionEventHandler : BaseGatewayEventHandler() {
return coreEvent
}

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
private suspend fun handle(
event: ApplicationCommandCreate,
shard: Int,
Expand All @@ -73,7 +73,7 @@ internal class InteractionEventHandler : BaseGatewayEventHandler() {
}


@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
private suspend fun handle(
event: ApplicationCommandUpdate,
shard: Int,
Expand All @@ -92,7 +92,7 @@ internal class InteractionEventHandler : BaseGatewayEventHandler() {
return coreEvent
}

@Suppress("DEPRECATION")
@Suppress("DEPRECATION_ERROR")
private suspend fun handle(
event: ApplicationCommandDelete,
shard: Int,
Expand Down
4 changes: 2 additions & 2 deletions gateway/api/gateway.api
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public final class dev/kord/gateway/GatewayConfigurationBuilder {

public final class dev/kord/gateway/GatewayKt {
public static final fun editPresence (Ldev/kord/gateway/Gateway;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun getGatewayOnLogger ()Lmu/KLogger;
public static final synthetic fun getGatewayOnLogger ()Lmu/KLogger;
public static final fun logCaughtThrowable (Ljava/lang/Throwable;)V
public static final fun requestGuildMembers (Ldev/kord/gateway/Gateway;Ldev/kord/common/entity/Snowflake;Lkotlin/jvm/functions/Function1;)Lkotlinx/coroutines/flow/Flow;
public static final fun requestGuildMembers (Ldev/kord/gateway/Gateway;Ldev/kord/gateway/RequestGuildMembers;)Lkotlinx/coroutines/flow/Flow;
Expand Down Expand Up @@ -1876,7 +1876,7 @@ public final class dev/kord/gateway/UserUpdate : dev/kord/gateway/DispatchEvent
}

public final class dev/kord/gateway/UtilsKt {
public static final fun error (Lmu/KLogger;Ljava/lang/Throwable;)V
public static final synthetic fun error (Lmu/KLogger;Ljava/lang/Throwable;)V
}

public final class dev/kord/gateway/VoiceServerUpdate : dev/kord/gateway/DispatchEvent {
Expand Down
Loading

0 comments on commit a7f64b9

Please sign in to comment.