-
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.
* move possible properties to login phase * Fix tests * make a value object * Revert "Fix tests" This reverts commit f50212b. * Fix the conflicts caused by fixing the conflicts * Re-apply fixes
- Loading branch information
Showing
9 changed files
with
42 additions
and
29 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.kord.gateway.builder | ||
|
||
import dev.kord.common.entity.PresenceStatus | ||
import dev.kord.gateway.DiscordPresence | ||
import dev.kord.gateway.Intents | ||
import kotlin.contracts.ExperimentalContracts | ||
import kotlin.contracts.InvocationKind | ||
import kotlin.contracts.contract | ||
|
||
data class Shards(val totalShards: Int, val indices: Iterable<Int> = 0 until totalShards) | ||
|
||
class LoginBuilder { | ||
var presence: DiscordPresence = DiscordPresence(PresenceStatus.Online, false) | ||
var intents: Intents = Intents.nonPrivileged | ||
var name: String = "Kord" | ||
|
||
@OptIn(ExperimentalContracts::class) | ||
fun presence(builder: PresenceBuilder.() -> Unit) { | ||
contract { callsInPlace(builder, InvocationKind.EXACTLY_ONCE) } | ||
this.presence = PresenceBuilder().apply(builder).toPresence() | ||
} | ||
} |