@@ -8,7 +8,7 @@ import com.kotlindiscord.kord.extensions.DISCORD_GREEN
8
8
import com.kotlindiscord.kord.extensions.DISCORD_RED
9
9
import com.kotlindiscord.kord.extensions.commands.Arguments
10
10
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
12
12
import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingInt
13
13
import com.kotlindiscord.kord.extensions.commands.converters.impl.defaultingString
14
14
import com.kotlindiscord.kord.extensions.commands.converters.impl.int
@@ -40,8 +40,6 @@ import dev.racci.elixir.utils.MODERATORS
40
40
import dev.racci.elixir.utils.MOD_ACTION_LOG
41
41
import dev.racci.elixir.utils.ResponseHelper
42
42
import dev.racci.elixir.utils.TRIALMODERATORS
43
- import kotlin.system.exitProcess
44
- import kotlin.time.ExperimentalTime
45
43
import kotlinx.coroutines.flow.catch
46
44
import kotlinx.coroutines.flow.collect
47
45
import kotlinx.coroutines.flow.filterNotNull
@@ -851,58 +849,121 @@ class Moderation : Extension() {
851
849
852
850
inner class ClearArgs : Arguments () {
853
851
854
- val messages by int(" messages" , " Messages" )
852
+ val messages by int {
853
+ name = " messages"
854
+ description = " Messages"
855
+ }
855
856
}
856
857
857
858
inner class KickArgs : Arguments () {
858
859
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
+ }
861
869
}
862
870
863
871
inner class BanArgs : Arguments () {
864
872
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
+ }
868
886
}
869
887
870
888
inner class UnbanArgs : Arguments () {
871
889
872
- val userArgument by user(" unbanUserId" , " Person Unbanned" )
890
+ val userArgument by user {
891
+ name = " unbanUserId"
892
+ description = " Person Unbanned"
893
+ }
873
894
}
874
895
875
896
inner class SoftBanArgs : Arguments () {
876
897
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
+ }
880
912
}
881
913
882
914
inner class SayArgs : Arguments () {
883
915
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
+ }
886
924
}
887
925
888
926
inner class PresenceArgs : Arguments () {
889
927
890
- val presenceArgument by string(" presence" , " Elixir's presence" )
928
+ val presenceArgument by string {
929
+ name = " presence"
930
+ description = " Presence"
931
+ }
891
932
}
892
933
893
934
inner class WarnArgs : Arguments () {
894
935
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
+ }
898
950
}
899
951
900
952
inner class TimeoutArgs : Arguments () {
901
953
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
+ }
907
968
}
908
969
}
0 commit comments