Skip to content

Commit ae72a64

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents de575c1 + 8ac2ef0 commit ae72a64

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

discord/channel.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ type GuildMessageChannel interface {
129129
Topic() *string
130130

131131
// NSFW returns whether the GuildMessageChannel is marked as not safe for work.
132+
// This is always false for GuildThread(s).
132133
NSFW() bool
133134

134135
// DefaultAutoArchiveDuration returns the default AutoArchiveDuration for GuildThread(s) in this GuildMessageChannel.
@@ -882,7 +883,6 @@ type GuildThread struct {
882883
channelType ChannelType
883884
guildID snowflake.ID
884885
name string
885-
nsfw bool
886886
lastMessageID *snowflake.ID
887887
lastPinTimestamp *time.Time
888888
rateLimitPerUser int
@@ -905,7 +905,6 @@ func (c *GuildThread) UnmarshalJSON(data []byte) error {
905905
c.channelType = v.Type
906906
c.guildID = v.GuildID
907907
c.name = v.Name
908-
c.nsfw = v.NSFW
909908
c.lastMessageID = v.LastMessageID
910909
c.lastPinTimestamp = v.LastPinTimestamp
911910
c.rateLimitPerUser = v.RateLimitPerUser
@@ -925,7 +924,6 @@ func (c GuildThread) MarshalJSON() ([]byte, error) {
925924
Type: c.channelType,
926925
GuildID: c.guildID,
927926
Name: c.name,
928-
NSFW: c.nsfw,
929927
LastMessageID: c.lastMessageID,
930928
LastPinTimestamp: c.lastPinTimestamp,
931929
RateLimitPerUser: c.rateLimitPerUser,
@@ -965,8 +963,9 @@ func (c GuildThread) Topic() *string {
965963
return nil
966964
}
967965

966+
// NSFW always returns false for GuildThread(s) as they do not have their own NSFW flag.
968967
func (c GuildThread) NSFW() bool {
969-
return c.nsfw
968+
return false
970969
}
971970

972971
func (c GuildThread) Name() string {

discord/channels_raw.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ type guildThread struct {
9090
Type ChannelType `json:"type"`
9191
GuildID snowflake.ID `json:"guild_id"`
9292
Name string `json:"name"`
93-
NSFW bool `json:"nsfw"`
9493
LastMessageID *snowflake.ID `json:"last_message_id"`
9594
RateLimitPerUser int `json:"rate_limit_per_user"`
9695
OwnerID snowflake.ID `json:"owner_id"`

0 commit comments

Comments
 (0)