Skip to content

Commit

Permalink
Whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPowerGamerBR committed Oct 22, 2024
1 parent 118112f commit d6d7815
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ class LorittaHelper(val config: LorittaHelperConfig, val fanArtsConfig: FanArtsC
commandManager.register(CheckCommandsCommand(this))

commandManager.register(DailyCatcherCheckCommand(this))
commandManager.register(PendingScarletCommand(this, jda))
commandManager.register(PendingReportsCommand(this, jda))
commandManager.register(PendingScarletCommand(this))
commandManager.register(PendingReportsCommand(this))
commandManager.register(IPLocationCommand(this))
commandManager.register(AttachDenyReasonCommand(this, jda))
commandManager.register(AttachDenyReasonCommand(this))
commandManager.register(AllTransactionsCommand(this))
commandManager.register(DirectDiscordCdnMessageCommand(this))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import net.perfectdreams.loritta.helper.utils.extensions.await
import net.perfectdreams.loritta.helper.utils.generateserverreport.GenerateAppealsReport
import net.perfectdreams.loritta.helper.utils.generateserverreport.GenerateServerReport

class AttachDenyReasonExecutor(helper: LorittaHelper, val jda: JDA) : HelperExecutor(helper, PermissionLevel.HELPER) {
class AttachDenyReasonExecutor(helper: LorittaHelper) : HelperExecutor(helper, PermissionLevel.HELPER) {
inner class Options : ApplicationCommandOptions() {
val messageUrl = string("message_url", "Link da Mensagem")

Expand All @@ -27,6 +27,7 @@ class AttachDenyReasonExecutor(helper: LorittaHelper, val jda: JDA) : HelperExec
)

override suspend fun executeHelper(context: ApplicationCommandContext, args: SlashCommandArguments) {
val jda = context.user.jda
val messageUrl = args[options.messageUrl]
val reason = args[options.reason]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import net.perfectdreams.loritta.helper.utils.generateserverreport.GenerateAppea
import net.perfectdreams.loritta.helper.utils.generateserverreport.GenerateServerReport
import net.perfectdreams.sequins.text.StringUtils

class PendingReportsExecutor(helper: LorittaHelper, val jda: JDA) : HelperExecutor(helper, PermissionLevel.ADMIN) {
class PendingReportsExecutor(helper: LorittaHelper) : HelperExecutor(helper, PermissionLevel.ADMIN) {
private val logger = KotlinLogging.logger {}

inner class Options : ApplicationCommandOptions() {
Expand All @@ -29,6 +29,7 @@ class PendingReportsExecutor(helper: LorittaHelper, val jda: JDA) : HelperExecut
override val options = Options()

override suspend fun executeHelper(context: ApplicationCommandContext, args: SlashCommandArguments) {
val jda = context.user.jda
context.deferChannelMessage(false)

val channelId = args[options.channel] ?: "${helper.config.guilds.community.channels.serverReports}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import net.perfectdreams.loritta.helper.utils.dailycatcher.SuspiciousLevel
import net.perfectdreams.loritta.helper.utils.extensions.await
import net.perfectdreams.sequins.text.StringUtils

class PendingScarletExecutor(helper: LorittaHelper, val jda: JDA) : HelperExecutor(helper, PermissionLevel.ADMIN) {
class PendingScarletExecutor(helper: LorittaHelper) : HelperExecutor(helper, PermissionLevel.ADMIN) {
private val logger = KotlinLogging.logger {}

inner class Options : ApplicationCommandOptions() {
Expand All @@ -28,6 +28,7 @@ class PendingScarletExecutor(helper: LorittaHelper, val jda: JDA) : HelperExecut
override val options = Options()

override suspend fun executeHelper(context: ApplicationCommandContext, args: SlashCommandArguments) {
val jda = context.user.jda
context.deferChannelMessage(false)

val channel = jda.getTextChannelById(DailyCatcherManager.SCARLET_POLICE_CHANNEL_ID) ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import net.perfectdreams.loritta.morenitta.interactions.commands.slashCommand
import net.perfectdreams.loritta.helper.LorittaHelper
import net.perfectdreams.loritta.helper.utils.slash.AttachDenyReasonExecutor

class AttachDenyReasonCommand(val helper: LorittaHelper, val jda: JDA) : SlashCommandDeclarationWrapper {
class AttachDenyReasonCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapper {
override fun command() = slashCommand(
"attachdenyreason",
"Adiciona na mensagem da denúncia o motivo por qual ela foi negada"
) {
executor = AttachDenyReasonExecutor(helper, jda)
executor = AttachDenyReasonExecutor(helper)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import net.perfectdreams.loritta.morenitta.interactions.commands.slashCommand
import net.perfectdreams.loritta.helper.LorittaHelper
import net.perfectdreams.loritta.helper.utils.slash.PendingReportsExecutor

class PendingReportsCommand(val helper: LorittaHelper, val jda: JDA) : SlashCommandDeclarationWrapper {
class PendingReportsCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapper {
override fun command() = slashCommand(
"pendingreports",
"Veja os reports/apelos pendentes do mês! \uD83D\uDC6E")
{
executor = PendingReportsExecutor(helper, jda)
executor = PendingReportsExecutor(helper)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import net.perfectdreams.loritta.morenitta.interactions.commands.slashCommand
import net.perfectdreams.loritta.helper.LorittaHelper
import net.perfectdreams.loritta.helper.utils.slash.PendingScarletExecutor

class PendingScarletCommand(val helper: LorittaHelper, val jda: JDA) : SlashCommandDeclarationWrapper {
class PendingScarletCommand(val helper: LorittaHelper) : SlashCommandDeclarationWrapper {
override fun command() = slashCommand(
"pendingscarlet",
"Scarlet Police, on Ghetto Patrol \uD83D\uDC83")
{
executor = PendingScarletExecutor(helper, jda)
executor = PendingScarletExecutor(helper)
}
}

0 comments on commit d6d7815

Please sign in to comment.