Skip to content

Commit

Permalink
Merge branch '0.8.x' into forums
Browse files Browse the repository at this point in the history
# Conflicts:
#	common/src/main/kotlin/entity/DiscordChannel.kt
  • Loading branch information
lukellmann committed Oct 13, 2022
2 parents 5d151e1 + 734a61e commit 0332a1d
Show file tree
Hide file tree
Showing 61 changed files with 439 additions and 74 deletions.
47 changes: 46 additions & 1 deletion common/api/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,27 @@ public final class dev/kord/common/entity/ActivityFlags$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class dev/kord/common/entity/ActivityType : java/lang/Enum {
public abstract class dev/kord/common/entity/ActivityType {
public static final field ActivityTypeSerializer Ldev/kord/common/entity/ActivityType$ActivityTypeSerializer;
public static final field Companion Ldev/kord/common/entity/ActivityType$Companion;
public static final field Competing Ldev/kord/common/entity/ActivityType;
public static final field Custom Ldev/kord/common/entity/ActivityType;
public static final field Game Ldev/kord/common/entity/ActivityType;
public static final field Listening Ldev/kord/common/entity/ActivityType;
public static final field Streaming Ldev/kord/common/entity/ActivityType;
public static final field Unknown Ldev/kord/common/entity/ActivityType;
public static final field Watching Ldev/kord/common/entity/ActivityType;
public synthetic fun <init> (ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun equals (Ljava/lang/Object;)Z
public final fun getCode ()I
public final fun hashCode ()I
public final fun toString ()Ljava/lang/String;
public static fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ActivityType;
public static fun values ()[Ldev/kord/common/entity/ActivityType;
}

public final class dev/kord/common/entity/ActivityType$ActivityTypeSerializer : kotlinx/serialization/KSerializer {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$ActivityTypeSerializer;
public fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/kord/common/entity/ActivityType;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
Expand All @@ -225,6 +231,41 @@ public final class dev/kord/common/entity/ActivityType$ActivityTypeSerializer :
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}

public final class dev/kord/common/entity/ActivityType$Companion {
public final fun getEntries ()Ljava/util/List;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
public fun valueOf (Ljava/lang/String;)Ldev/kord/common/entity/ActivityType;
public fun values ()[Ldev/kord/common/entity/ActivityType;
}

public final class dev/kord/common/entity/ActivityType$Competing : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Competing;
}

public final class dev/kord/common/entity/ActivityType$Custom : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Custom;
}

public final class dev/kord/common/entity/ActivityType$Game : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Game;
}

public final class dev/kord/common/entity/ActivityType$Listening : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Listening;
}

public final class dev/kord/common/entity/ActivityType$Streaming : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Streaming;
}

public final class dev/kord/common/entity/ActivityType$Unknown : dev/kord/common/entity/ActivityType {
public fun <init> (I)V
}

public final class dev/kord/common/entity/ActivityType$Watching : dev/kord/common/entity/ActivityType {
public static final field INSTANCE Ldev/kord/common/entity/ActivityType$Watching;
}

public final class dev/kord/common/entity/AllRemovedMessageReactions {
public static final field Companion Ldev/kord/common/entity/AllRemovedMessageReactions$Companion;
public synthetic fun <init> (ILdev/kord/common/entity/Snowflake;Ldev/kord/common/entity/Snowflake;Ldev/kord/common/entity/optional/OptionalSnowflake;Lkotlinx/serialization/internal/SerializationConstructorMarker;)V
Expand Down Expand Up @@ -562,10 +603,14 @@ public final class dev/kord/common/entity/ApplicationFlags$Companion {
public abstract class dev/kord/common/entity/ArchiveDuration {
public static final field Companion Ldev/kord/common/entity/ArchiveDuration$Companion;
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun equals (Ljava/lang/Object;)Z
public final fun getDuration-UwyO8pc ()J
public final fun hashCode ()I
public final fun toString ()Ljava/lang/String;
}

public final class dev/kord/common/entity/ArchiveDuration$Companion {
public final fun getEntries ()Ljava/util/List;
public final fun getValues ()Ljava/util/Set;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [AllowedMentionType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types).
*/
@Serializable(with = AllowedMentionType.Serializer::class)
public sealed class AllowedMentionType(
/**
Expand Down Expand Up @@ -68,9 +72,9 @@ public sealed class AllowedMentionType(

public override fun deserialize(decoder: Decoder) =
when (val value = decoder.decodeString()) {
"everyone" -> EveryoneMentions
"roles" -> RoleMentions
"users" -> UserMentions
"everyone" -> EveryoneMentions
else -> Unknown(value)
}
}
Expand All @@ -81,9 +85,9 @@ public sealed class AllowedMentionType(
*/
public val entries: List<AllowedMentionType> by lazy(mode = PUBLICATION) {
listOf(
EveryoneMentions,
RoleMentions,
UserMentions,
EveryoneMentions,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ApplicationCommandOptionType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type).
*/
@Serializable(with = ApplicationCommandOptionType.Serializer::class)
public sealed class ApplicationCommandOptionType(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ApplicationCommandPermissionType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type).
*/
@Serializable(with = ApplicationCommandPermissionType.Serializer::class)
public sealed class ApplicationCommandPermissionType(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ApplicationCommandType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types).
*/
@Serializable(with = ApplicationCommandType.Serializer::class)
public sealed class ApplicationCommandType(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [AuditLogEvent]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events).
*/
@Serializable(with = AuditLogEvent.Serializer::class)
public sealed class AuditLogEvent(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import kotlinx.serialization.encoding.Encoder

/**
* The type of action.
*
* See [AutoModerationActionType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types).
*/
@Serializable(with = AutoModerationActionType.Serializer::class)
public sealed class AutoModerationActionType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import kotlinx.serialization.encoding.Encoder

/**
* Indicates in what event context a rule should be checked.
*
* See [AutoModerationRuleEventType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types).
*/
@Serializable(with = AutoModerationRuleEventType.Serializer::class)
public sealed class AutoModerationRuleEventType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import kotlinx.serialization.encoding.Encoder

/**
* An internally pre-defined wordset which will be searched for in content.
*
* See [AutoModerationRuleKeywordPresetType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types).
*/
@Serializable(with = AutoModerationRuleKeywordPresetType.Serializer::class)
public sealed class AutoModerationRuleKeywordPresetType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import kotlinx.serialization.encoding.Encoder

/**
* Characterizes the type of content which can trigger the rule.
*
* See [AutoModerationRuleTriggerType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types).
*/
@Serializable(with = AutoModerationRuleTriggerType.Serializer::class)
public sealed class AutoModerationRuleTriggerType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import kotlinx.serialization.encoding.Encoder
/**
* Style of a [button][dev.kord.common.entity.ComponentType.Button].
*
* A preview of the different styles can be found
* [here](https://discord.com/developers/docs/interactions/message-components#button-object-button-styles).
* See [ButtonStyle]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/interactions/message-components#button-object-button-styles).
*/
@Serializable(with = ButtonStyle.NewSerializer::class)
public sealed class ButtonStyle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ChannelType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/channel#channel-object-channel-types).
*/
@Serializable(with = ChannelType.Serializer::class)
public sealed class ChannelType(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ComponentType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/interactions/message-components#component-object-component-types).
*/
@Serializable(with = ComponentType.NewSerializer::class)
public sealed class ComponentType(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [DefaultMessageNotificationLevel]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level).
*/
@Serializable(with = DefaultMessageNotificationLevel.Serializer::class)
public sealed class DefaultMessageNotificationLevel(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [DiscordConnectionVisibility]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/user#connection-object-visibility-types).
*/
@Serializable(with = DiscordConnectionVisibility.Serializer::class)
public sealed class DiscordConnectionVisibility(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [EmbedType]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/channel#embed-object-embed-types).
*/
@Serializable(with = EmbedType.Serializer::class)
public sealed class EmbedType(
/**
Expand Down Expand Up @@ -82,12 +86,12 @@ public sealed class EmbedType(

public override fun deserialize(decoder: Decoder) =
when (val value = decoder.decodeString()) {
"article" -> Article
"gifv" -> Gifv
"image" -> Image
"link" -> Link
"rich" -> Rich
"image" -> Image
"video" -> Video
"gifv" -> Gifv
"article" -> Article
"link" -> Link
else -> Unknown(value)
}
}
Expand All @@ -98,12 +102,12 @@ public sealed class EmbedType(
*/
public val entries: List<EmbedType> by lazy(mode = PUBLICATION) {
listOf(
Article,
Gifv,
Image,
Link,
Rich,
Image,
Video,
Gifv,
Article,
Link,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [ExplicitContentFilter]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level).
*/
@Serializable(with = ExplicitContentFilter.Serializer::class)
public sealed class ExplicitContentFilter(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [GuildFeature]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild#guild-object-guild-features).
*/
@Serializable(with = GuildFeature.Serializer::class)
public sealed class GuildFeature(
/**
Expand Down Expand Up @@ -164,26 +168,26 @@ public sealed class GuildFeature(
public object Commerce : GuildFeature("COMMERCE")

/**
* Guild has access to the three-day archive time for threads
* Guild has access to the seven day archive time for threads.
*
* @suppress.
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Thread archive durations are no longer boost locked.",
)
public object ThreeDayThreadArchive : GuildFeature("THREE_DAY_THREAD_ARCHIVE")
public object SevenDayThreadArchive : GuildFeature("SEVEN_DAY_THREAD_ARCHIVE")

/**
* Guild has access to the seven day archive time for threads.
* Guild has access to the three-day archive time for threads.
*
* @suppress
*/
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Thread archive durations are no longer boost locked.",
)
public object SevenDayThreadArchive : GuildFeature("SEVEN_DAY_THREAD_ARCHIVE")
public object ThreeDayThreadArchive : GuildFeature("THREE_DAY_THREAD_ARCHIVE")

internal object Serializer : KSerializer<GuildFeature> {
public override val descriptor: SerialDescriptor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [GuildScheduledEventPrivacyLevel]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level).
*/
@Serializable(with = GuildScheduledEventPrivacyLevel.Serializer::class)
public sealed class GuildScheduledEventPrivacyLevel(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [GuildScheduledEventStatus]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status).
*/
@Serializable(with = GuildScheduledEventStatus.NewSerializer::class)
public sealed class GuildScheduledEventStatus(
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import kotlinx.serialization.descriptors.SerialDescriptor
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder

/**
* See [IntegrationExpireBehavior]s in the
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors).
*/
@Serializable(with = IntegrationExpireBehavior.NewSerializer::class)
public sealed class IntegrationExpireBehavior(
/**
Expand Down
Loading

0 comments on commit 0332a1d

Please sign in to comment.