-
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
Conversation
shouldn't this be added to the create data as well |
Yes, I forgot about that, let me add it there too |
Done 😊 |
I guess you missed the thread create builder as well |
it's called the StartThreadRequest but since properties are being added to it maybe make a builder if you will. |
I added the |
reason: String? = null, | ||
): TextChannelThread { | ||
return unsafeStartThread(name, archiveDuration, ChannelType.PublicGuildThread, reason) as TextChannelThread | ||
return unsafeStartThread( | ||
name, | ||
archiveDuration, | ||
ChannelType.PublicGuildThread | ||
) { | ||
this.reason = reason | ||
} as TextChannelThread |
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:
suspend fun startPublicThread(
name: String,
archiveDuration: ArchiveDuration = ArchiveDuration.Day,
builder: StartThread.() -> Unit
): TextChannelThread
and then pass it to unsafe
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 comment
The reason will be displayed to describe this comment to others. Learn more.
make type a val
here, you don't want to make a switch in the types which makes the builder no longer useful.
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.
Only val
for the ChannelType
, or for name
and autoArchiveDuration
too?
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.
type
only
The
invitable
field controls this option