Skip to content

Commit

Permalink
Revert "Create a moderation arguments class to shrink the arguments d…
Browse files Browse the repository at this point in the history
…own"

This reverts commit b82f7ef.
  • Loading branch information
NoComment1105 committed Apr 2, 2024
1 parent b82f7ef commit aab071a
Showing 1 changed file with 135 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -956,20 +956,72 @@ class ModerationCommands : Extension() {
}
}

inner class BanArgs : ModerationArguments() {
inner class BanArgs : Arguments() {
/** The user to ban. */
val userArgument by user {
name = "user"
description = "Person to ban"
}

/** The number of days worth of messages to delete. */
val messages by int {
name = "delete-message-days"
description = "The number of days worth of messages to delete"
}

/** The reason for the ban. */
val reason by defaultingString {
name = "reason"
description = "The reason for the ban"
defaultValue = "No reason provided"
}

/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the ban"
defaultValue = true
}

/** An image that the user wishes to provide for context to the ban. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
}
}

inner class SoftBanArgs : ModerationArguments() {
inner class SoftBanArgs : Arguments() {
/** The user to soft-ban. */
val userArgument by user {
name = "user"
description = "Person to Soft ban"
}

/** The number of days worth of messages to delete, defaults to 3 days. */
val messages by optionalInt {
name = "delete-message-days"
description = "The number of days worth of messages to delete"
}

/** The reason for the soft-ban. */
val reason by defaultingString {
name = "reason"
description = "The reason for the ban"
defaultValue = "No reason provided"
}

/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the soft-ban"
defaultValue = true
}

/** An image that the user wishes to provide for context to the soft-ban. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
}
}

inner class UnbanArgs : Arguments() {
Expand All @@ -987,14 +1039,66 @@ class ModerationCommands : Extension() {
}
}

inner class KickArgs : ModerationArguments()
inner class KickArgs : Arguments() {
/** The user to kick. */
val userArgument by user {
name = "user"
description = "Person to kick"
}

/** The reason for the kick. */
val reason by defaultingString {
name = "reason"
description = "The reason for the Kick"
defaultValue = "No reason provided"
}

/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the kick"
defaultValue = true
}

/** An image that the user wishes to provide for context to the kick. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
}
}

inner class TimeoutArgs : Arguments() {
/** The requested user to timeout. */
val userArgument by user {
name = "user"
description = "Person to timeout"
}

inner class TimeoutArgs : ModerationArguments() {
/** The time the timeout should last for. */
val duration by coalescingOptionalDuration {
name = "duration"
description = "Duration of timeout"
}

/** The reason for the timeout. */
val reason by defaultingString {
name = "reason"
description = "Reason for timeout"
defaultValue = "No reason provided"
}

/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the timeout"
defaultValue = true
}

/** An image that the user wishes to provide for context to the kick. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
}
}

inner class RemoveTimeoutArgs : Arguments() {
Expand All @@ -1012,13 +1116,18 @@ class ModerationCommands : Extension() {
}
}

inner class WarnArgs : ModerationArguments()

inner class RemoveWarnArgs : Arguments() {
/** The requested user to remove the warning from. */
inner class WarnArgs : Arguments() {
/** The requested user to warn. */
val userArgument by user {
name = "user"
description = "Person to remove warn from"
description = "Person to warn"
}

/** The reason for the warning. */
val reason by defaultingString {
name = "reason"
description = "Reason for warning"
defaultValue = "No reason provided"
}

/** Whether to DM the user or not. */
Expand All @@ -1027,34 +1136,27 @@ class ModerationCommands : Extension() {
description = "Whether to send a direct message to the user about the warning"
defaultValue = true
}
}
}

open class ModerationArguments : Arguments() {
/** The target user to apply the action too. */
val userArgument by user {
name = "user"
description = "The user to apply this action too"
}

/** The reason for the action. */
val reason by defaultingString {
name = "reason"
description = "Reason for action"
defaultValue = "No reason provided"
/** An image that the user wishes to provide for context to the kick. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
}
}

/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the action"
defaultValue = true
}
inner class RemoveWarnArgs : Arguments() {
/** The requested user to remove the warning from. */
val userArgument by user {
name = "user"
description = "Person to remove warn from"
}

/** An image that the user wishes to provide for context to the action. */
val image by optionalAttachment {
name = "image"
description = "An image you'd like to provide as extra context for the action"
/** Whether to DM the user or not. */
val dm by defaultingBoolean {
name = "dm"
description = "Whether to send a direct message to the user about the warning"
defaultValue = true
}
}
}

Expand Down

0 comments on commit aab071a

Please sign in to comment.