-
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 missing `invitable` field * Add the "invitable" flag in the ThreadModifyBuilder, ChannelData and ThreadMetadata * Add invitable flag to the StartThreadBuilder * Add invitable flag on the startThread methods * Start Thread builders * Use thread builders in the core module * Make ChannelType val instead of var * Use the StartThreadBuilder for the Audit Log reason instead of using a reason argument Co-authored-by: Hope <[email protected]>
- Loading branch information
1 parent
f6545a9
commit 7a2e86e
Showing
10 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
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
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
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
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
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
25 changes: 25 additions & 0 deletions
25
rest/src/main/kotlin/builder/channel/thread/StartThreadBuilder.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,25 @@ | ||
package dev.kord.rest.builder.channel.thread | ||
|
||
import dev.kord.common.entity.ArchiveDuration | ||
import dev.kord.common.entity.ChannelType | ||
import dev.kord.common.entity.optional.OptionalBoolean | ||
import dev.kord.common.entity.optional.delegate.delegate | ||
import dev.kord.common.entity.optional.optional | ||
import dev.kord.rest.builder.AuditRequestBuilder | ||
import dev.kord.rest.json.request.StartThreadRequest | ||
|
||
class StartThreadBuilder(var name: String, var autoArchiveDuration: ArchiveDuration, val type: ChannelType) : AuditRequestBuilder<StartThreadRequest> { | ||
override var reason: String? = null | ||
|
||
private var _invitable: OptionalBoolean = OptionalBoolean.Missing | ||
var invitable: Boolean? by ::_invitable.delegate() | ||
|
||
override fun toRequest(): StartThreadRequest { | ||
return StartThreadRequest( | ||
name = name, | ||
autoArchiveDuration = autoArchiveDuration, | ||
type = type.optional(), // Currently this is optional, but in API v10 it will be required according to Discord's docs. | ||
invitable = _invitable | ||
) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
rest/src/main/kotlin/builder/channel/thread/StartThreadWithMessageBuilder.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,16 @@ | ||
package dev.kord.rest.builder.channel.thread | ||
|
||
import dev.kord.common.entity.ArchiveDuration | ||
import dev.kord.rest.builder.AuditRequestBuilder | ||
import dev.kord.rest.json.request.StartThreadRequest | ||
|
||
class StartThreadWithMessageBuilder(var name: String, var autoArchiveDuration: ArchiveDuration) : AuditRequestBuilder<StartThreadRequest> { | ||
override var reason: String? = null | ||
|
||
override fun toRequest(): StartThreadRequest { | ||
return StartThreadRequest( | ||
name = name, | ||
autoArchiveDuration = autoArchiveDuration | ||
) | ||
} | ||
} |
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
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
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