-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add forum error codes * update docs of Permission.SendMessages for forums * add ChannelType.GuildForum * add ChannelFlags * add DiscordChannel.flags * add ChannelData.flags * add Channel.flags * add cache updates for lastMessageId of forum channels * Implmenet high level abstractions * Error 220003 * API dump * Fix compile error * More error codes * Add `ChannelFlag.RequireTag` * Add `thread_name` for execute webhook * Regenerate `ChannelType` * Remove `nsfwLevel` from channel * Dump API * Add SortOrderType * Add missing fields to DiscordChannel * Imports * Add missing properties for channel builders (#712) * Add missing properties for create forum channel * api dump * add missing fields in the other builders * api dump * move flags to forum threads * apply suggestions * Small fixes Co-authored-by: Lukellmann <lukellmann@gmail.com> * TextChannelModifyBuilder.defaultThreadRateLimitPerUser * Update KDoc for ChannelType.PublicGuildThread see discord/discord-api-docs#5556 * Add ChannelData.defaultSortOrder (#727) * Add default forum layout (#749) * Fix nullability and docs * Add missing default layout to core type (#752) * Message counts and position for channel and message (#726) * Message counts and position for channel and message * Api Dump * Is this dump better? * Update caches for message count and total message sent * Fix merge * Forum posts (#709) * support for creating forum posts * api dump * support for uploading files on forum posts * more support to forums and forum threads * fix errors * maintain code consistency * add forum tag routes * Api Dump * Update Intent KDoc * Check for applied tags * Remove ForumChannelThread type * Move possible functions to ForumChannelBehavior * add applied tags to modify builder * Properly configure JVM auto-provisioning * Fix appliedTags mutability * Fix spacings * Final fixes --------- Co-authored-by: Luis <40919071+dookon@users.noreply.github.com> Co-authored-by: Lukellmann <lukellmann@gmail.com> Co-authored-by: hope <truehope9000@gmail.com> Co-authored-by: Michael Rittmeister <michael@rittmeister.in> --------- Co-authored-by: Lukellmann <lukellmann@gmail.com> Co-authored-by: Lukellmann <47486203+Lukellmann@users.noreply.github.com> Co-authored-by: Luis <40919071+dookon@users.noreply.github.com> Co-authored-by: NoComment <67918617+NoComment1105@users.noreply.github.com> Co-authored-by: Michael Rittmeister <michael@rittmeister.in> Co-authored-by: Luis <luisflima.bg@gmail.com>
- Loading branch information
1 parent
6c14449
commit b976bf0
Showing
50 changed files
with
2,331 additions
and
292 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
common/build/generated/ksp/main/kotlin/dev/kord/common/entity/ForumLayoutType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT! | ||
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting", | ||
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection")) | ||
|
||
package dev.kord.common.entity | ||
|
||
import kotlin.Any | ||
import kotlin.Boolean | ||
import kotlin.Int | ||
import kotlin.LazyThreadSafetyMode.PUBLICATION | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.collections.List | ||
import kotlinx.serialization.KSerializer | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.descriptors.PrimitiveKind | ||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor | ||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
|
||
/** | ||
* See [ForumLayoutType]s in the | ||
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/channel#channel-object-forum-layout-types). | ||
*/ | ||
@Serializable(with = ForumLayoutType.Serializer::class) | ||
public sealed class ForumLayoutType( | ||
/** | ||
* The raw value used by Discord. | ||
*/ | ||
public val `value`: Int, | ||
) { | ||
public final override fun equals(other: Any?): Boolean = this === other || | ||
(other is ForumLayoutType && this.value == other.value) | ||
|
||
public final override fun hashCode(): Int = value.hashCode() | ||
|
||
public final override fun toString(): String = | ||
"ForumLayoutType.${this::class.simpleName}(value=$value)" | ||
|
||
/** | ||
* An unknown [ForumLayoutType]. | ||
* | ||
* This is used as a fallback for [ForumLayoutType]s that haven't been added to Kord yet. | ||
*/ | ||
public class Unknown( | ||
`value`: Int, | ||
) : ForumLayoutType(value) | ||
|
||
/** | ||
* No default has been set for forum channel. | ||
*/ | ||
public object NotSet : ForumLayoutType(0) | ||
|
||
/** | ||
* Display posts as a list. | ||
*/ | ||
public object ListView : ForumLayoutType(1) | ||
|
||
/** | ||
* Display posts as a collection of tiles. | ||
*/ | ||
public object GalleryView : ForumLayoutType(2) | ||
|
||
internal object Serializer : KSerializer<ForumLayoutType> { | ||
public override val descriptor: SerialDescriptor = | ||
PrimitiveSerialDescriptor("dev.kord.common.entity.ForumLayoutType", | ||
PrimitiveKind.INT) | ||
|
||
public override fun serialize(encoder: Encoder, `value`: ForumLayoutType) = | ||
encoder.encodeInt(value.value) | ||
|
||
public override fun deserialize(decoder: Decoder) = when (val value = decoder.decodeInt()) { | ||
0 -> NotSet | ||
1 -> ListView | ||
2 -> GalleryView | ||
else -> Unknown(value) | ||
} | ||
} | ||
|
||
public companion object { | ||
/** | ||
* A [List] of all known [ForumLayoutType]s. | ||
*/ | ||
public val entries: List<ForumLayoutType> by lazy(mode = PUBLICATION) { | ||
listOf( | ||
NotSet, | ||
ListView, | ||
GalleryView, | ||
) | ||
} | ||
|
||
} | ||
} |
86 changes: 86 additions & 0 deletions
86
common/build/generated/ksp/main/kotlin/dev/kord/common/entity/SortOrderType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// THIS FILE IS AUTO-GENERATED BY KordEnumProcessor.kt, DO NOT EDIT! | ||
@file:Suppress(names = arrayOf("RedundantVisibilityModifier", "IncorrectFormatting", | ||
"ReplaceArrayOfWithLiteral", "SpellCheckingInspection", "GrazieInspection")) | ||
|
||
package dev.kord.common.entity | ||
|
||
import kotlin.Any | ||
import kotlin.Boolean | ||
import kotlin.Int | ||
import kotlin.LazyThreadSafetyMode.PUBLICATION | ||
import kotlin.String | ||
import kotlin.Suppress | ||
import kotlin.collections.List | ||
import kotlinx.serialization.KSerializer | ||
import kotlinx.serialization.Serializable | ||
import kotlinx.serialization.descriptors.PrimitiveKind | ||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor | ||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
|
||
/** | ||
* See [SortOrderType]s in the | ||
* [Discord Developer Documentation](https://discord.com/developers/docs/resources/channel#channel-object-sort-order-types). | ||
*/ | ||
@Serializable(with = SortOrderType.Serializer::class) | ||
public sealed class SortOrderType( | ||
/** | ||
* The raw value used by Discord. | ||
*/ | ||
public val `value`: Int, | ||
) { | ||
public final override fun equals(other: Any?): Boolean = this === other || | ||
(other is SortOrderType && this.value == other.value) | ||
|
||
public final override fun hashCode(): Int = value.hashCode() | ||
|
||
public final override fun toString(): String = | ||
"SortOrderType.${this::class.simpleName}(value=$value)" | ||
|
||
/** | ||
* An unknown [SortOrderType]. | ||
* | ||
* This is used as a fallback for [SortOrderType]s that haven't been added to Kord yet. | ||
*/ | ||
public class Unknown( | ||
`value`: Int, | ||
) : SortOrderType(value) | ||
|
||
/** | ||
* Sort forum posts by activity. | ||
*/ | ||
public object LatestActivity : SortOrderType(0) | ||
|
||
/** | ||
* Sort forum posts by creation time (from most recent to oldest). | ||
*/ | ||
public object CreationDate : SortOrderType(1) | ||
|
||
internal object Serializer : KSerializer<SortOrderType> { | ||
public override val descriptor: SerialDescriptor = | ||
PrimitiveSerialDescriptor("dev.kord.common.entity.SortOrderType", PrimitiveKind.INT) | ||
|
||
public override fun serialize(encoder: Encoder, `value`: SortOrderType) = | ||
encoder.encodeInt(value.value) | ||
|
||
public override fun deserialize(decoder: Decoder) = when (val value = decoder.decodeInt()) { | ||
0 -> LatestActivity | ||
1 -> CreationDate | ||
else -> Unknown(value) | ||
} | ||
} | ||
|
||
public companion object { | ||
/** | ||
* A [List] of all known [SortOrderType]s. | ||
*/ | ||
public val entries: List<SortOrderType> by lazy(mode = PUBLICATION) { | ||
listOf( | ||
LatestActivity, | ||
CreationDate, | ||
) | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.