Skip to content
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

Merged
merged 9 commits into from
Oct 5, 2021
Merged

Add missing invitable field #398

merged 9 commits into from
Oct 5, 2021

Conversation

MrPowerGamerBR
Copy link
Contributor

The invitable field controls this option

image

@HopeBaron
Copy link
Member

shouldn't this be added to the create data as well

@MrPowerGamerBR
Copy link
Contributor Author

shouldn't this be added to the create data as well

Yes, I forgot about that, let me add it there too

@MrPowerGamerBR
Copy link
Contributor Author

Done 😊

@HopeBaron
Copy link
Member

I guess you missed the thread create builder as well

@MrPowerGamerBR
Copy link
Contributor Author

I guess you missed the thread create builder as well

I think that a ThreadCreateBuilder doesn't exist (yet) :(

image

@HopeBaron
Copy link
Member

it's called the StartThreadRequest but since properties are being added to it maybe make a builder if you will.

@MrPowerGamerBR
Copy link
Contributor Author

I added the StartThreadBuilder, however I'm not sure if the changes that I made to the core module are correct

Comment on lines 75 to 83
reason: String? = null,
): TextChannelThread {
return unsafeStartThread(name, archiveDuration, ChannelType.PublicGuildThread, reason) as TextChannelThread
return unsafeStartThread(
name,
archiveDuration,
ChannelType.PublicGuildThread
) {
this.reason = reason
} as TextChannelThread
Copy link
Member

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> {
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type only

@HopeBaron HopeBaron merged commit 7a2e86e into kordlib:0.8.x Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants