@@ -302,6 +302,28 @@ const (
302
302
ChannelFlagRequireTag ChannelFlags = 1 << 4
303
303
)
304
304
305
+ // ForumSortOrderType represents sort order of a forum channel.
306
+ type ForumSortOrderType int
307
+
308
+ const (
309
+ // ForumSortOrderLatestActivity sorts posts by activity.
310
+ ForumSortOrderLatestActivity ForumSortOrderType = 0
311
+ // ForumSortOrderCreationDate sorts posts by creation time (from most recent to oldest).
312
+ ForumSortOrderCreationDate ForumSortOrderType = 1
313
+ )
314
+
315
+ // ForumLayout represents layout of a forum channel.
316
+ type ForumLayout int
317
+
318
+ const (
319
+ // ForumLayoutNotSet represents no default layout.
320
+ ForumLayoutNotSet ForumLayout = 0
321
+ // ForumLayoutListView displays forum posts as a list.
322
+ ForumLayoutListView ForumLayout = 1
323
+ // ForumLayoutGalleryView displays forum posts as a collection of tiles.
324
+ ForumLayoutGalleryView ForumLayout = 2
325
+ )
326
+
305
327
// A Channel holds all data related to an individual Discord channel.
306
328
type Channel struct {
307
329
// The ID of the channel.
@@ -390,6 +412,18 @@ type Channel struct {
390
412
391
413
// Emoji to use as the default reaction to a forum post.
392
414
DefaultReactionEmoji ForumDefaultReaction `json:"default_reaction_emoji"`
415
+
416
+ // The initial RateLimitPerUser to set on newly created threads in a channel.
417
+ // This field is copied to the thread at creation time and does not live update.
418
+ DefaultThreadRateLimitPerUser int `json:"default_thread_rate_limit_per_user"`
419
+
420
+ // The default sort order type used to order posts in forum channels.
421
+ // Defaults to null, which indicates a preferred sort order hasn't been set by a channel admin.
422
+ DefaultSortOrder * ForumSortOrderType `json:"default_sort_order"`
423
+
424
+ // The default forum layout view used to display posts in forum channels.
425
+ // Defaults to ForumLayoutNotSet, which indicates a layout view has not been set by a channel admin.
426
+ DefaultForumLayout ForumLayout `json:"default_forum_layout"`
393
427
}
394
428
395
429
// Mention returns a string which mentions the channel
@@ -404,16 +438,17 @@ func (c *Channel) IsThread() bool {
404
438
405
439
// A ChannelEdit holds Channel Field data for a channel edit.
406
440
type ChannelEdit struct {
407
- Name string `json:"name,omitempty"`
408
- Topic string `json:"topic,omitempty"`
409
- NSFW * bool `json:"nsfw,omitempty"`
410
- Position int `json:"position"`
411
- Bitrate int `json:"bitrate,omitempty"`
412
- UserLimit int `json:"user_limit,omitempty"`
413
- PermissionOverwrites []* PermissionOverwrite `json:"permission_overwrites,omitempty"`
414
- ParentID string `json:"parent_id,omitempty"`
415
- RateLimitPerUser * int `json:"rate_limit_per_user,omitempty"`
416
- Flags * ChannelFlags `json:"flags,omitempty"`
441
+ Name string `json:"name,omitempty"`
442
+ Topic string `json:"topic,omitempty"`
443
+ NSFW * bool `json:"nsfw,omitempty"`
444
+ Position int `json:"position"`
445
+ Bitrate int `json:"bitrate,omitempty"`
446
+ UserLimit int `json:"user_limit,omitempty"`
447
+ PermissionOverwrites []* PermissionOverwrite `json:"permission_overwrites,omitempty"`
448
+ ParentID string `json:"parent_id,omitempty"`
449
+ RateLimitPerUser * int `json:"rate_limit_per_user,omitempty"`
450
+ Flags * ChannelFlags `json:"flags,omitempty"`
451
+ DefaultThreadRateLimitPerUser * int `json:"default_thread_rate_limit_per_user,omitempty"`
417
452
418
453
// NOTE: threads only
419
454
@@ -426,6 +461,8 @@ type ChannelEdit struct {
426
461
427
462
AvailableTags * []ForumTag `json:"available_tags,omitempty"`
428
463
DefaultReactionEmoji * ForumDefaultReaction `json:"default_reaction_emoji,omitempty"`
464
+ DefaultSortOrder * ForumSortOrderType `json:"default_sort_order,omitempty"` // TODO: null
465
+ DefaultForumLayout * ForumLayout `json:"default_forum_layout,omitempty"`
429
466
430
467
// NOTE: forum threads only
431
468
AppliedTags * []string `json:"applied_tags,omitempty"`
0 commit comments