Skip to content

Commit cc3f479

Browse files
author
Racci
committed
chore(dep): Update to kord 1.5.2-RC1
1 parent 5853b0c commit cc3f479

File tree

3 files changed

+98
-28
lines changed

3 files changed

+98
-28
lines changed

libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[versions]
22

33
groovy = "3.0.9"
4-
kord-extensions = "1.5.1-SNAPSHOT"
4+
kord-extensions = "1.5.2-RC1"
55
logging = "2.1.21"
66
logback = "1.2.8"
77

src/main/kotlin/dev/racci/elixir/extensions/commands/moderation/Moderation.kt

Lines changed: 85 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import com.kotlindiscord.kord.extensions.DISCORD_GREEN
88
import com.kotlindiscord.kord.extensions.DISCORD_RED
99
import com.kotlindiscord.kord.extensions.commands.Arguments
1010
import com.kotlindiscord.kord.extensions.commands.converters.impl.boolean
11-
import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingCoalescingDuration
11+
import com.kotlindiscord.kord.extensions.commands.converters.impl.coalescingDefaultingDuration
1212
import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingInt
1313
import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingString
1414
import com.kotlindiscord.kord.extensions.commands.converters.impl.int
@@ -40,8 +40,6 @@ import dev.racci.elixir.utils.MODERATORS
4040
import dev.racci.elixir.utils.MOD_ACTION_LOG
4141
import dev.racci.elixir.utils.ResponseHelper
4242
import dev.racci.elixir.utils.TRIALMODERATORS
43-
import kotlin.system.exitProcess
44-
import kotlin.time.ExperimentalTime
4543
import kotlinx.coroutines.flow.catch
4644
import kotlinx.coroutines.flow.collect
4745
import kotlinx.coroutines.flow.filterNotNull
@@ -851,58 +849,121 @@ class Moderation : Extension() {
851849

852850
inner class ClearArgs : Arguments() {
853851

854-
val messages by int("messages", "Messages")
852+
val messages by int {
853+
name = "messages"
854+
description = "Messages"
855+
}
855856
}
856857

857858
inner class KickArgs : Arguments() {
858859

859-
val userArgument by user("kickUser", "Person to kick")
860-
val reason by defaultingString("reason", "The reason for the Kick", "No Reason Provided")
860+
val userArgument by user {
861+
name = "kickUser"
862+
description = "Person to kick"
863+
}
864+
val reason by defaultingString {
865+
name = "reason"
866+
description = "The reason for the Kick"
867+
defaultValue = "No Reason Provided"
868+
}
861869
}
862870

863871
inner class BanArgs : Arguments() {
864872

865-
val userArgument by user("banUser", "Person to ban")
866-
val messages by int("messages", "Messages")
867-
val reason by defaultingString("reason", "The reason for the ban", "No Reason Provided")
873+
val userArgument by user {
874+
name = "banUser"
875+
description = "Person to ban"
876+
}
877+
val messages by int {
878+
name = "messages"
879+
description = "Messages"
880+
}
881+
val reason by defaultingString {
882+
name = "reason"
883+
description = "The reason for the ban"
884+
defaultValue = "No Reason Provided"
885+
}
868886
}
869887

870888
inner class UnbanArgs : Arguments() {
871889

872-
val userArgument by user("unbanUserId", "Person Unbanned")
890+
val userArgument by user {
891+
name = "unbanUserId"
892+
description = "Person Unbanned"
893+
}
873894
}
874895

875896
inner class SoftBanArgs : Arguments() {
876897

877-
val userArgument by user("softBanUser", "Person to Soft ban")
878-
val messages by defaultingInt("messages", "Messages", 3)
879-
val reason by defaultingString("reason", "The reason for the ban", "No Reason Provided")
898+
val userArgument by user {
899+
name = "softBanUser"
900+
description = "Person to Soft ban"
901+
}
902+
val messages by defaultingInt {
903+
name = "messages"
904+
description = "Messages"
905+
defaultValue = 3
906+
}
907+
val reason by defaultingString {
908+
name = "reason"
909+
description = "The reason for the ban"
910+
defaultValue = "No Reason Provided"
911+
}
880912
}
881913

882914
inner class SayArgs : Arguments() {
883915

884-
val messageArgument by string("message", "Message contents")
885-
val embedMessage by boolean("embed", "Would you like to send as embed")
916+
val messageArgument by string {
917+
name = "message"
918+
description = "Message contents"
919+
}
920+
val embedMessage by boolean {
921+
name = "embed"
922+
description = "Would you like to send as embed"
923+
}
886924
}
887925

888926
inner class PresenceArgs : Arguments() {
889927

890-
val presenceArgument by string("presence", "Elixir's presence")
928+
val presenceArgument by string {
929+
name = "presence"
930+
description = "Presence"
931+
}
891932
}
892933

893934
inner class WarnArgs : Arguments() {
894935

895-
val userArgument by user("warnUser", "Person to Warn")
896-
val warnPoints by defaultingInt("points", "Amount of points to add", 10)
897-
val reason by defaultingString("reason", "Reason for Warn", "No Reason Provided")
936+
val userArgument by user {
937+
name = "warnUser"
938+
description = "Person to Warn"
939+
}
940+
val warnPoints by defaultingInt {
941+
name = "points"
942+
description = "Amount of points to add"
943+
defaultValue = 10
944+
}
945+
val reason by defaultingString {
946+
name = "reason"
947+
description = "Reason for Warn"
948+
defaultValue = "No Reason Provided"
949+
}
898950
}
899951

900952
inner class TimeoutArgs : Arguments() {
901953

902-
val userArgument by user("timeoutUser", "Person to timeout")
903-
val duration by defaultingCoalescingDuration("duration",
904-
"Duration of timeout",
905-
DateTimePeriod(0, 0, 0, 6, 0, 0, 0))
906-
val reason by defaultingString("reason", "Reason for timeout", "No reason provided")
954+
val userArgument by user {
955+
name = "timeoutUser"
956+
description = "Person to timeout"
957+
}
958+
val duration by coalescingDefaultingDuration {
959+
name = "duration"
960+
description = "Duration of timeout"
961+
defaultValue = DateTimePeriod(0, 0, 0, 6, 0, 0, 0)
962+
}
963+
val reason by defaultingString {
964+
name = "reason"
965+
description = "Reason for timeout"
966+
defaultValue = "No reason provided"
967+
}
907968
}
908969
}

src/main/kotlin/dev/racci/elixir/extensions/commands/util/Github.kt

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,22 @@ class Github : Extension() {
470470

471471
inner class IssueArgs : Arguments() {
472472

473-
val repository by string("repository", "The GitHub repository you would like to search")
474-
val issue by int("issue-number", "The issue number you would like to search for")
473+
val repository by string {
474+
name = "repository"
475+
description = "The GitHub repository you would like to search"
476+
}
477+
val issue by int {
478+
name = "issue-number"
479+
description = "The issue number you would like to search for"
480+
}
475481
}
476482

477483
inner class RepoArgs : Arguments() {
478484

479-
val repository by string("repository", "The github repository you would like to search for")
485+
val repository by string {
486+
name = "repository"
487+
description = "The github repository you would like to search for"
488+
}
480489
}
481490

482491
inner class UserArgs : Arguments() {

0 commit comments

Comments
 (0)