-
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 stage channel create functions (#856)
They were just missing.
- Loading branch information
1 parent
892a770
commit 9c6b492
Showing
6 changed files
with
139 additions
and
9 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
53 changes: 53 additions & 0 deletions
53
rest/src/commonMain/kotlin/builder/channel/StageChannelCreateBuilder.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,53 @@ | ||
package dev.kord.rest.builder.channel | ||
|
||
import dev.kord.common.annotation.KordDsl | ||
import dev.kord.common.entity.ChannelType | ||
import dev.kord.common.entity.Overwrite | ||
import dev.kord.common.entity.Snowflake | ||
import dev.kord.common.entity.optional.Optional | ||
import dev.kord.common.entity.optional.OptionalBoolean | ||
import dev.kord.common.entity.optional.OptionalInt | ||
import dev.kord.common.entity.optional.OptionalSnowflake | ||
import dev.kord.common.entity.optional.delegate.delegate | ||
import dev.kord.rest.builder.AuditRequestBuilder | ||
import dev.kord.rest.json.request.GuildChannelCreateRequest | ||
import kotlin.time.Duration | ||
|
||
@KordDsl | ||
public class StageChannelCreateBuilder(public var name: String) : | ||
PermissionOverwritesCreateBuilder, | ||
AuditRequestBuilder<GuildChannelCreateRequest> { | ||
override var reason: String? = null | ||
|
||
private var _bitrate: OptionalInt = OptionalInt.Missing | ||
public var bitrate: Int? by ::_bitrate.delegate() | ||
|
||
private var _userLimit: OptionalInt = OptionalInt.Missing | ||
public var userLimit: Int? by ::_userLimit.delegate() | ||
|
||
private var _rateLimitPerUser: Optional<Duration> = Optional.Missing() | ||
public var rateLimitPerUser: Duration? by ::_rateLimitPerUser.delegate() | ||
|
||
private var _position: OptionalInt = OptionalInt.Missing | ||
public var position: Int? by ::_position.delegate() | ||
|
||
override var permissionOverwrites: MutableSet<Overwrite> = mutableSetOf() | ||
|
||
private var _parentId: OptionalSnowflake = OptionalSnowflake.Missing | ||
public var parentId: Snowflake? by ::_parentId.delegate() | ||
|
||
private var _nsfw: OptionalBoolean = OptionalBoolean.Missing | ||
public var nsfw: Boolean? by ::_nsfw.delegate() | ||
|
||
override fun toRequest(): GuildChannelCreateRequest = GuildChannelCreateRequest( | ||
name = name, | ||
type = ChannelType.GuildStageVoice, | ||
bitrate = _bitrate, | ||
userLimit = _userLimit, | ||
rateLimitPerUser = _rateLimitPerUser, | ||
position = _position, | ||
permissionOverwrite = Optional.missingOnEmpty(permissionOverwrites), | ||
parentId = _parentId, | ||
nsfw = _nsfw | ||
) | ||
} |
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