@@ -254,6 +254,20 @@ const (
254
254
ChannelTypeGuildPublicThread ChannelType = 11
255
255
ChannelTypeGuildPrivateThread ChannelType = 12
256
256
ChannelTypeGuildStageVoice ChannelType = 13
257
+ ChannelTypeGuildForum ChannelType = 15
258
+ )
259
+
260
+ // ChannelFlags represent flags of a channel/thread.
261
+ type ChannelFlags int
262
+
263
+ // Block containing known ChannelFlags values.
264
+ const (
265
+ // ChannelFlagPinned indicates whether the thread is pinned in the forum channel.
266
+ // NOTE: forum threads only.
267
+ ChannelFlagPinned ChannelFlags = 1 << 1
268
+ // ChannelFlagRequireTag indicates whether a tag is required to be specified when creating a thread.
269
+ // NOTE: forum channels only.
270
+ ChannelFlagRequireTag ChannelFlags = 1 << 4
257
271
)
258
272
259
273
// A Channel holds all data related to an individual Discord channel.
@@ -332,6 +346,18 @@ type Channel struct {
332
346
333
347
// All thread members. State channels only.
334
348
Members []* ThreadMember `json:"-"`
349
+
350
+ // Channel flags.
351
+ Flags ChannelFlags `json:"flags"`
352
+
353
+ // The set of tags that can be used in a forum channel.
354
+ AvailableTags []ForumTag `json:"available_tags"`
355
+
356
+ // The IDs of the set of tags that have been applied to a thread in a forum channel.
357
+ AppliedTags []string `json:"applied_tags"`
358
+
359
+ // Emoji to use as the default reaction to a forum post.
360
+ DefaultReactionEmoji ForumDefaultReaction `json:"default_reaction_emoji"`
335
361
}
336
362
337
363
// Mention returns a string which mentions the channel
@@ -355,13 +381,22 @@ type ChannelEdit struct {
355
381
PermissionOverwrites []* PermissionOverwrite `json:"permission_overwrites,omitempty"`
356
382
ParentID string `json:"parent_id,omitempty"`
357
383
RateLimitPerUser * int `json:"rate_limit_per_user,omitempty"`
384
+ Flags * ChannelFlags `json:"flags,omitempty"`
358
385
359
386
// NOTE: threads only
360
387
361
388
Archived * bool `json:"archived,omitempty"`
362
389
AutoArchiveDuration int `json:"auto_archive_duration,omitempty"`
363
390
Locked * bool `json:"locked,omitempty"`
364
391
Invitable * bool `json:"invitable,omitempty"`
392
+
393
+ // NOTE: forum channels only
394
+
395
+ AvailableTags * []ForumTag `json:"available_tags,omitempty"`
396
+ DefaultReactionEmoji * ForumDefaultReaction `json:"default_reaction_emoji,omitempty"`
397
+
398
+ // NOTE: forum threads only
399
+ AppliedTags * []string `json:"applied_tags,omitempty"`
365
400
}
366
401
367
402
// A ChannelFollow holds data returned after following a news channel
@@ -395,6 +430,9 @@ type ThreadStart struct {
395
430
Type ChannelType `json:"type,omitempty"`
396
431
Invitable bool `json:"invitable"`
397
432
RateLimitPerUser int `json:"rate_limit_per_user,omitempty"`
433
+
434
+ // NOTE: forum threads only
435
+ AppliedTags []string `json:"applied_tags,omitempty"`
398
436
}
399
437
400
438
// ThreadMetadata contains a number of thread-specific channel fields that are not needed by other channel types.
@@ -438,6 +476,24 @@ type AddedThreadMember struct {
438
476
Presence * Presence `json:"presence"`
439
477
}
440
478
479
+ // ForumDefaultReaction specifies emoji to use as the default reaction to a forum post.
480
+ // NOTE: Exactly one of EmojiID and EmojiName must be set.
481
+ type ForumDefaultReaction struct {
482
+ // The id of a guild's custom emoji.
483
+ EmojiID string `json:"emoji_id,omitempty"`
484
+ // The unicode character of the emoji.
485
+ EmojiName string `json:"emoji_name,omitempty"`
486
+ }
487
+
488
+ // ForumTag represents a tag that is able to be applied to a thread in a forum channel.
489
+ type ForumTag struct {
490
+ ID string `json:"id,omitempty"`
491
+ Name string `json:"name"`
492
+ Moderated bool `json:"moderated"`
493
+ EmojiID string `json:"emoji_id,omitempty"`
494
+ EmojiName string `json:"emoji_name,omitempty"`
495
+ }
496
+
441
497
// Emoji struct holds data related to Emoji's
442
498
type Emoji struct {
443
499
ID string `json:"id"`
@@ -2074,6 +2130,7 @@ const (
2074
2130
ErrCodeUnknownGuildWelcomeScreen = 10069
2075
2131
ErrCodeUnknownGuildScheduledEvent = 10070
2076
2132
ErrCodeUnknownGuildScheduledEventUser = 10071
2133
+ ErrUnknownTag = 10087
2077
2134
2078
2135
ErrCodeBotsCannotUseEndpoint = 20001
2079
2136
ErrCodeOnlyBotsCanUseEndpoint = 20002
@@ -2087,28 +2144,30 @@ const (
2087
2144
ErrCodeStageTopicContainsNotAllowedWordsForPublicStages = 20031
2088
2145
ErrCodeGuildPremiumSubscriptionLevelTooLow = 20035
2089
2146
2090
- ErrCodeMaximumGuildsReached = 30001
2091
- ErrCodeMaximumPinsReached = 30003
2092
- ErrCodeMaximumNumberOfRecipientsReached = 30004
2093
- ErrCodeMaximumGuildRolesReached = 30005
2094
- ErrCodeMaximumNumberOfWebhooksReached = 30007
2095
- ErrCodeMaximumNumberOfEmojisReached = 30008
2096
- ErrCodeTooManyReactions = 30010
2097
- ErrCodeMaximumNumberOfGuildChannelsReached = 30013
2098
- ErrCodeMaximumNumberOfAttachmentsInAMessageReached = 30015
2099
- ErrCodeMaximumNumberOfInvitesReached = 30016
2100
- ErrCodeMaximumNumberOfAnimatedEmojisReached = 30018
2101
- ErrCodeMaximumNumberOfServerMembersReached = 30019
2102
- ErrCodeMaximumNumberOfGuildDiscoverySubcategoriesReached = 30030
2103
- ErrCodeGuildAlreadyHasATemplate = 30031
2104
- ErrCodeMaximumNumberOfThreadParticipantsReached = 30033
2105
- ErrCodeMaximumNumberOfBansForNonGuildMembersHaveBeenExceeded = 30035
2106
- ErrCodeMaximumNumberOfBansFetchesHasBeenReached = 30037
2107
- ErrCodeMaximumNumberOfUncompletedGuildScheduledEventsReached = 30038
2108
- ErrCodeMaximumNumberOfStickersReached = 30039
2109
- ErrCodeMaximumNumberOfPruneRequestsHasBeenReached = 30040
2110
- ErrCodeMaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30042
2111
- ErrCodeMaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30046
2147
+ ErrCodeMaximumGuildsReached = 30001
2148
+ ErrCodeMaximumPinsReached = 30003
2149
+ ErrCodeMaximumNumberOfRecipientsReached = 30004
2150
+ ErrCodeMaximumGuildRolesReached = 30005
2151
+ ErrCodeMaximumNumberOfWebhooksReached = 30007
2152
+ ErrCodeMaximumNumberOfEmojisReached = 30008
2153
+ ErrCodeTooManyReactions = 30010
2154
+ ErrCodeMaximumNumberOfGuildChannelsReached = 30013
2155
+ ErrCodeMaximumNumberOfAttachmentsInAMessageReached = 30015
2156
+ ErrCodeMaximumNumberOfInvitesReached = 30016
2157
+ ErrCodeMaximumNumberOfAnimatedEmojisReached = 30018
2158
+ ErrCodeMaximumNumberOfServerMembersReached = 30019
2159
+ ErrCodeMaximumNumberOfGuildDiscoverySubcategoriesReached = 30030
2160
+ ErrCodeGuildAlreadyHasATemplate = 30031
2161
+ ErrCodeMaximumNumberOfThreadParticipantsReached = 30033
2162
+ ErrCodeMaximumNumberOfBansForNonGuildMembersHaveBeenExceeded = 30035
2163
+ ErrCodeMaximumNumberOfBansFetchesHasBeenReached = 30037
2164
+ ErrCodeMaximumNumberOfUncompletedGuildScheduledEventsReached = 30038
2165
+ ErrCodeMaximumNumberOfStickersReached = 30039
2166
+ ErrCodeMaximumNumberOfPruneRequestsHasBeenReached = 30040
2167
+ ErrCodeMaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30042
2168
+ ErrCodeMaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30046
2169
+ ErrCodeMaximumNumberOfPinnedThreadsInForumChannelHasBeenReached = 30047
2170
+ ErrCodeMaximumNumberOfTagsInForumChannelHasBeenReached = 30048
2112
2171
2113
2172
ErrCodeUnauthorized = 40001
2114
2173
ErrCodeActionRequiredVerifiedAccount = 40002
@@ -2121,6 +2180,7 @@ const (
2121
2180
ErrCodeMessageAlreadyCrossposted = 40033
2122
2181
ErrCodeAnApplicationWithThatNameAlreadyExists = 40041
2123
2182
ErrCodeInteractionHasAlreadyBeenAcknowledged = 40060
2183
+ ErrCodeTagNamesMustBeUnique = 40061
2124
2184
2125
2185
ErrCodeMissingAccess = 50001
2126
2186
ErrCodeInvalidAccountType = 50002
0 commit comments