-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing invitable
field
#398
Changes from 6 commits
93be910
37fd7bd
a37ece5
77ae706
c4fc0f0
9a219b2
da3854a
7a9c090
3b304bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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, var type: ChannelType) : AuditRequestBuilder<StartThreadRequest> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make type a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
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 | ||
) | ||
} | ||
} |
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 | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the reason from here, add the builder as a part of the function
so:
and then pass it to unsafe