diff --git a/.dockerignore b/.dockerignore
index 1c7ce56..0b6a882 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,3 @@
**.nils
/run
/run/
-docker-compose.yml
diff --git a/.forgejo/workflows/action.yml b/.forgejo/workflows/action.yml
index 4eff152..8418c1c 100644
--- a/.forgejo/workflows/action.yml
+++ b/.forgejo/workflows/action.yml
@@ -5,10 +5,12 @@ on:
jobs:
build-gradle-project:
- runs-on: docker
+ runs-on: ubuntu-latest
steps:
- name: apt update
run: apt update
+ - name: apt upgrade
+ run: apt upgrade -y
- name: install prerequisits
run: apt install openjdk-17-jdk ca-certificates-java ssl-cert openssl ca-certificates -y
- name: Checkout project sources
diff --git a/README.md b/README.md
index e1768f6..6d87924 100644
--- a/README.md
+++ b/README.md
@@ -4,13 +4,15 @@
A Discord Bot for Splatoon Teams.
+More information can be found on the [Homepage](https://liljudd.ink).
+
## Contributors
[](https://gitlab.com/moonleay)
## Known issues
-##### If you encounter any bugs, message me on Discord (@moonleay) or email me (issues@moonleay.net). You can also open a ticket [on the support server](https://discord.gg/HTZRktfH4A).
+##### If you encounter any bugs, message me on Discord (@moonleay) or send me a mail (issues@moonleay.net). You can also open a ticket [on the support server](https://discord.gg/HTZRktfH4A).
## Commands & Features
@@ -20,34 +22,23 @@ A Discord Bot for Splatoon Teams.
- match -- Create a new match
- updateroles -- Update the roles of all users
- sendplanner -- Send the planner message
- - rotation -- See the current rotation
- Features
- Time Planner -- Make the bot send messages and reactions into a selected channel in order to make planning easier
- Availability Manager -- Make the bot assign users roles every day, so it is possible to notify available people
- Match Planner -- Make a match, for which players can sign up and the bot will assign teams and roles to them
-## The todo list
+## (Maybe) upcoming features
##### See the [todo list](https://todo.moonleay.net/share/OmisuzgPDdsrCAXKjGrTfYzWwqNDNclOMGJWeMsi/auth?view=kanban) for more information.
## How to self-host (using the Docker container)
-1. Copy the docker-compose.yml file from the repository.
-2. Install docker and docker-compose.
-3. Create a directory called "data" in the same directory as the docker-compose.yml file.
-4. Create a directory called "config" in the same directory as the docker-compose.yml file.
-5. Start the bot once.
-6. After 10 seconds, stop the bot.
-7. Open the config file "credentials.nils" in the config directory.
-8. Put in your credentials.
- 1. token: your Discord bot token
- 2. dbDomain: the domain and port of your postgresql database (e.g.: "postgresql", when using the docker-compose.yml
- file)
- 3. dbName: the name of the database
- 4. dbUser: the username of the database
- 5. dbPassword: the password to the db user
-9. Start the bot again.
-10. The bot should now be up and running.
+1. Pull the container from [Docker Hub](https://hub.docker.com/repository/docker/limiteddev/liljudd/general)
+2. Map /data/ to a folder on disk
+3. Run the Bot once
+4. follow step 4 and 5 from the JAR section
+5. Run the Bot again
+6. Profit.
## How to self-host (using the JAR)
diff --git a/build.gradle.kts b/build.gradle.kts
index 0ad11dc..48416b1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,27 +21,25 @@ import org.jetbrains.gradle.ext.TaskTriggersConfig
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
- kotlin("jvm") version "1.9.22"
- kotlin("plugin.serialization") version "1.9.22"
+ kotlin("jvm") version "1.9.10"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
`maven-publish`
}
//lilJudd version 2
-val creatorID = 372703841151614976L
+val ownerID = 372703841151614976L
group = "net.moonleay.liljudd"
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
- ?: "2.7.2"
+ ?: "2.6.5"
-val kordver = "1.7.1-SNAPSHOT"
+val kordver = "1.5.9-SNAPSHOT"
val coroutinesver = "1.7.3"
-val ktorver = "2.3.7"
-val exposedver = "0.46.0"
-val postgresver = "42.7.1"
-val krontabver = "2.2.6"
-val kotlinxserializationver = "1.6.0"
+val ktorver = "2.3.5"
+val exposedver = "0.43.0"
+val postgresver = "42.6.0"
+val krontabver = "2.2.1"
val mavenArtifact = "lilJudd"
project.base.archivesName.set(mavenArtifact)
@@ -95,9 +93,6 @@ dependencies {
//Coroutines
shadow("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesver")
- //JSON Stuff
- shadow("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxserializationver")
-
//Logging
shadow("org.slf4j:slf4j-api:2.0.3")
shadow("org.slf4j:slf4j-simple:2.0.3")
@@ -110,8 +105,8 @@ dependencies {
//Krontab
shadow("dev.inmo:krontab:$krontabver")
- shadow("io.ktor:ktor-client-core-jvm:$ktorver")
- shadow("io.ktor:ktor-client-cio-jvm:$ktorver")
+ shadow("io.ktor:ktor-client-core-jvm:2.3.5")
+ shadow("io.ktor:ktor-client-cio-jvm:2.3.5")
}
@@ -120,14 +115,13 @@ val templateSrc = project.rootDir.resolve("src/main/templates")
val templateDest = project.projectDir.resolve("build/generated/templates")
val templateProps = mapOf(
"version" to project.version as String,
- "creatorID" to creatorID,
+ "ownerID" to ownerID,
"kordversion" to kordver,
"coroutinesversion" to coroutinesver,
"ktorversion" to ktorver,
"exposedversion" to exposedver,
"postgresversion" to postgresver,
- "krontabversion" to krontabver,
- "kotlinxserializationversion" to kotlinxserializationver
+ "krontabversion" to krontabver
)
diff --git a/docker-compose.yml b/docker-compose.yml
deleted file mode 100644
index af8faef..0000000
--- a/docker-compose.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-version: "3"
-services:
- lilJudd:
- container_name: liljudd
- image: limiteddev/liljudd:x.x.x
- deploy:
- resources:
- limits:
- cpus: "1"
- memory: 1G
- networks:
- - traefik
- restart: unless-stopped
- volumes:
- - ./config/liljudd/:/data/
- postgresql:
- container_name: postgresql
- image: postgres:13.3-alpine
- deploy:
- resources:
- limits:
- cpus: "1"
- memory: 1G
- environment:
- - POSTGRES_USER=liljudd
- - POSTGRES_PASSWORD=changeme
- - POSTGRES_DB=liljudd
- networks:
- - traefik
- restart: unless-stopped
- volumes:
- - ./data/postgresql/:/var/lib/postgresql/data/
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index d64cd49..41d9927 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 3ba58b0..14cf480 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#
# lilJudd
-# Copyright (C) 2024 moonleay
+# Copyright (C) 2023 moonleay
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -18,8 +18,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
-networkTimeout=10000
-validateDistributionUrl=true
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index bf6021c..99d219e 100755
--- a/gradlew
+++ b/gradlew
@@ -2,7 +2,7 @@
#
# lilJudd
-# Copyright (C) 2024 moonleay
+# Copyright (C) 2023 moonleay
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -82,11 +82,13 @@ do
esac
done
-# This is normally unused
-# shellcheck disable=SC2034
+APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
+
+APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
-# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,29 +135,22 @@ location of your Java installation."
fi
else
JAVACMD=java
- if ! command -v java >/dev/null 2>&1
- then
- die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
- fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
- # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
- # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
- # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -200,15 +195,11 @@ if "$cygwin" || "$msys" ; then
done
fi
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Collect all arguments for the java command:
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
-# and any embedded shellness will be escaped.
-# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
-# treated as '${Hostname}' itself on the command line.
+# Collect all arguments for the java command;
+# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
+# shell script including quotes and variable substitutions, so put them in
+# double quotes to make sure that they get re-expanded; and
+# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -216,12 +207,6 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"
-# Stop when "xargs" is not available.
-if ! command -v xargs >/dev/null 2>&1
-then
- die "xargs is not available"
-fi
-
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
diff --git a/gradlew.bat b/gradlew.bat
index 93e3f59..107acd3 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%"=="" @echo off
+@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,8 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
+if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -41,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
+if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -76,15 +75,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if %ERRORLEVEL% equ 0 goto mainEnd
+if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-set EXIT_CODE=%ERRORLEVEL%
-if %EXIT_CODE% equ 0 set EXIT_CODE=1
-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
-exit /b %EXIT_CODE%
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/src/main/kotlin/net/moonleay/liljudd/Bot.kt b/src/main/kotlin/net/moonleay/lilJudd/Bot.kt
similarity index 64%
rename from src/main/kotlin/net/moonleay/liljudd/Bot.kt
rename to src/main/kotlin/net/moonleay/lilJudd/Bot.kt
index 2e5e5aa..05f7ba8 100644
--- a/src/main/kotlin/net/moonleay/liljudd/Bot.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/Bot.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,10 +16,9 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd
+package net.moonleay.lilJudd
import com.kotlindiscord.kord.extensions.ExtensibleBot
-import com.kotlindiscord.kord.extensions.utils.dm
import dev.kord.common.entity.PresenceStatus
import dev.kord.core.behavior.interaction.response.respond
import dev.kord.core.event.gateway.ReadyEvent
@@ -27,28 +26,23 @@ import dev.kord.core.event.interaction.ButtonInteractionCreateEvent
import dev.kord.core.on
import dev.kord.gateway.Intent
import dev.kord.gateway.PrivilegedIntent
-import dev.kord.gateway.builder.Shards
-import dev.kord.rest.builder.message.embed
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
+import net.moonleay.lilJudd.buttons.component.EditButtonManager
+import net.moonleay.lilJudd.data.CredentialManager
+import net.moonleay.lilJudd.data.database.DB
+import net.moonleay.lilJudd.extensions.*
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.features.MatchManager
+import net.moonleay.lilJudd.features.TimeManager
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
import net.moonleay.liljudd.build.BuildConstants
-import net.moonleay.liljudd.buttons.component.EditButtonManager
-import net.moonleay.liljudd.data.CredentialManager
-import net.moonleay.liljudd.data.NewsManager
-import net.moonleay.liljudd.data.StacktraceSaver
-import net.moonleay.liljudd.data.database.DB
-import net.moonleay.liljudd.extensions.*
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.features.MatchManager
-import net.moonleay.liljudd.features.TimeManager
-import net.moonleay.liljudd.util.EmbedColor
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
import kotlin.system.exitProcess
-
object Bot {
//The kord object gets set at app launch
lateinit var bot: ExtensibleBot
@@ -74,12 +68,6 @@ object Bot {
exitProcess(3)
}
- // Check if there are api credentials
- if (CredentialManager.apiDomain == "empty" || CredentialManager.apiToken == "empty") {
- Logger.out("The config does not contain the whole API credentials.")
- exitProcess(3)
- }
-
// Connect to the database
DB.connect(
CredentialManager.dbDomain,
@@ -116,7 +104,6 @@ object Bot {
add(::SendPlannerExtension)
add(::MatchExtension)
add(::UpdateRolesExtension)
- add(::RotationExtension)
}
this.presence {
@@ -128,26 +115,11 @@ object Bot {
+Intent.GuildMembers
}
- errorResponse { _, type ->
- val stamp = System.currentTimeMillis()
- this.embed {
- this.title = "Oops. Something went wrong."
- this.description = "The bot encountered an error during execution.\n" +
- "Please report this to <@${BuildConstants.creatorID}>.\n" +
- "The errorid is \"$stamp.stk\""
- this.field {
- this.name = "Error message:"
- this.value = type.error.message.toString()
- this.inline = false
- }
- }
-
- StacktraceSaver.saveStacktrace(type.error, stamp)
- }
-
- this.sharding { recommended ->
+ // Will add Sharding someday, I promise
+ /*
+ sharding { recommended ->
Shards(recommended)
- }
+ } */
}
// Register button presses
@@ -185,39 +157,13 @@ object Bot {
bot.kordRef.on {
AvailabilityManager.runThread() // Update Availabilities
MatchManager.update() // Update Matches
- // Load news
- NewsManager.load()
- if(NewsManager.shouldPost == "yes"){
- val contactedOwners = mutableListOf()
- bot.kordRef.guilds.collect {
- val owner = it.owner.asUser()
- if (!contactedOwners.contains(owner.id.value)) {
- Logger.out("Sent News to ${owner.username} from ${it.name}")
- owner.dm {
- this.embed {
- this.title = NewsManager.title
- this.description = NewsManager.news
- this.footer {
- this.icon = bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
- }
- contactedOwners.add(owner.id.value)
- }
- }
- NewsManager.shouldPost = "no"
- NewsManager.update()
- }
-
-
// Make the bot update the status every 6 seconds
-// JobManager.addJob(StatusUpdater)
+ // JobManager.addJob(StatusUpdater)
}
// Update the Splatoon 3 api data and make sure it stays up-to-date
-// Splatoon3Api.updateSchedule()
-// JobManager.addJob(Splatoon3ApiScheduleUpdateScheduler)
+ // Splatoon3ApiCache.updateData(ApiDataType.SCHEDULES, ApiRequestType.AUTOMATIC_CACHE_CREATION_AT_STARTUP)
+ // JobManager.addJob(Splatoon3ApiScheduleUpdateScheduler)
/*
Other caches will be added when implemented
its not used yet in order to reduce load on the api,
@@ -226,6 +172,10 @@ object Bot {
// Had to disable bc of an error.
// Will fix when I have time
+
+ //JobManager.addJob(Splatoon3ApiFestivalAndCoopUpdateScheduler)
+ //JobManager.addJob(Splatoon3ApiSplatnetGearUpdateScheduler)
+
//Start the bot
bot.start()
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/Main.kt b/src/main/kotlin/net/moonleay/lilJudd/Main.kt
similarity index 73%
rename from src/main/kotlin/net/moonleay/liljudd/Main.kt
rename to src/main/kotlin/net/moonleay/lilJudd/Main.kt
index a1196f8..36be8b3 100644
--- a/src/main/kotlin/net/moonleay/liljudd/Main.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/Main.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,10 +15,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-package net.moonleay.liljudd
+package net.moonleay.lilJudd
import net.moonleay.liljudd.build.BuildConstants
-import net.moonleay.liljudd.util.Logger
suspend fun main() {
@@ -28,11 +27,9 @@ suspend fun main() {
"| |_| |__| |_ _ _| |_| |\n" +
"| | | | | | | | . | . |\n" +
"|_|_|_|_____|___|___|___|\n" +
- "v.${BuildConstants.version}\n"
+ " "
)
-
- Logger.out("li'l Judd made by moonleay (https://moonleay.net). Web UI made by aronmal (https://mal-noh.de).")
- Logger.out("For more information check out https://liljudd.ink and https://git.moonleay.net/DiscordBots/lilJudd")
+ println("v.${BuildConstants.version}")
Bot.start()
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/component/EditButtonManager.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt
similarity index 67%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/component/EditButtonManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt
index 384a09d..f0df57f 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/component/EditButtonManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,14 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.component
+package net.moonleay.lilJudd.buttons.component
-import net.moonleay.liljudd.buttons.matchplanner.AcceptEditButton
-import net.moonleay.liljudd.buttons.matchplanner.CancelEditButton
-import net.moonleay.liljudd.buttons.matchplanner.DeclineEditButton
-import net.moonleay.liljudd.buttons.timeplanner.IsAvailableEditButton
-import net.moonleay.liljudd.buttons.timeplanner.MaybeAvailableEditButton
-import net.moonleay.liljudd.buttons.timeplanner.NotAvailableEditButton
+import net.moonleay.lilJudd.buttons.matchplanner.AcceptEditButton
+import net.moonleay.lilJudd.buttons.matchplanner.CancelEditButton
+import net.moonleay.lilJudd.buttons.matchplanner.DeclineEditButton
+import net.moonleay.lilJudd.buttons.timeplanner.IsAvailableEditButton
+import net.moonleay.lilJudd.buttons.timeplanner.MaybeAvailableEditButton
+import net.moonleay.lilJudd.buttons.timeplanner.NotAvailableEditButton
object EditButtonManager {
val buttons = listOf(
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/component/IEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/IEditButton.kt
similarity index 93%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/component/IEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/component/IEditButton.kt
index d973ceb..0fbe64e 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/component/IEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/IEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.component
+package net.moonleay.lilJudd.buttons.component
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
import dev.kord.core.entity.Guild
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/AcceptEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/AcceptEditButton.kt
similarity index 81%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/AcceptEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/AcceptEditButton.kt
index 7e7e382..4e04fa1 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/AcceptEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/AcceptEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.matchplanner
+package net.moonleay.lilJudd.buttons.matchplanner
import dev.kord.common.entity.Snowflake
import dev.kord.core.behavior.edit
@@ -25,16 +25,15 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.EmbedBuilder
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.util.EmbedUtil
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.util.EmbedUtil
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
-class AcceptEditButton : IEditButton {
+class AcceptEditButton() : IEditButton {
override val id: String = "public.edit.btn.matchmanagement.accept"
override suspend fun onInteraction(
@@ -60,7 +59,7 @@ class AcceptEditButton : IEditButton {
Logger.out("role is null")
return
}
- val member = interaction.user.asMember(guild.id)
+ val member = interaction.user.asMember(guild.id) ?: return
// do the checks and update
if (m.embeds[0].fields[0].value.contains(user.id.value.toString())) {
if (member.roleIds.contains(Snowflake(mpdd.roleID))) {
@@ -90,13 +89,13 @@ class AcceptEditButton : IEditButton {
if (shouldEditButton) {
// update the message
Bot.bot.kordRef.getChannelOf(interaction.channelId)!!.getMessage(m.id).edit {
- this.embed(fun EmbedBuilder.() {
- color = eb.color
- title = eb.title
- description = eb.description
- fields = eb.fields
- footer = eb.footer
- })
+ this.embed {
+ this.color = eb.color
+ this.title = eb.title
+ this.description = eb.description
+ this.fields = eb.fields
+ this.footer = eb.footer
+ }
}
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/CancelEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/CancelEditButton.kt
similarity index 77%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/CancelEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/CancelEditButton.kt
index 07e1016..348446c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/CancelEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/CancelEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.matchplanner
+package net.moonleay.lilJudd.buttons.matchplanner
import dev.kord.common.entity.Snowflake
import dev.kord.core.behavior.edit
@@ -25,13 +25,12 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.EmbedBuilder
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.util.EmbedUtil
-import net.moonleay.liljudd.util.Logger
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.util.EmbedUtil
+import net.moonleay.lilJudd.util.Logger
class CancelEditButton : IEditButton {
override val id: String = "public.edit.btn.matchmanagement.cancel"
@@ -63,14 +62,14 @@ class CancelEditButton : IEditButton {
member.removeRole(role.id)
}
Bot.bot.kordRef.getChannelOf(interaction.channelId)!!.getMessage(m.id).edit {
- this.embed(fun EmbedBuilder.() {
+ this.embed {
val temp = EmbedUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 1)
- color = temp.color
- title = temp.title
- description = temp.description
- fields = temp.fields
- footer = temp.footer
- })
+ this.color = temp.color
+ this.title = temp.title
+ this.description = temp.description
+ this.fields = temp.fields
+ this.footer = temp.footer
+ }
}
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/DeclineEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/DeclineEditButton.kt
similarity index 82%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/DeclineEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/DeclineEditButton.kt
index 06f7e44..93f6b36 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/matchplanner/DeclineEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/matchplanner/DeclineEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.matchplanner
+package net.moonleay.lilJudd.buttons.matchplanner
import dev.kord.common.entity.Snowflake
import dev.kord.core.behavior.edit
@@ -25,14 +25,13 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.EmbedBuilder
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.util.EmbedUtil
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.util.EmbedUtil
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
class DeclineEditButton : IEditButton {
override val id: String = "public.edit.btn.matchmanagement.decline"
@@ -60,7 +59,7 @@ class DeclineEditButton : IEditButton {
Logger.out("role is null")
return
}
- val member = interaction.user.asMember(guild.id)
+ val member = interaction.user.asMember(guild.id) ?: return
if (m.embeds[0].fields[0].value.contains(user.id.value.toString())) {
if (member.roleIds.contains(Snowflake(mpdd.roleID))) {
Logger.out("Removing role from ${member.username}")
@@ -90,13 +89,13 @@ class DeclineEditButton : IEditButton {
if (shouldEditButton) {
// update the message
Bot.bot.kordRef.getChannelOf(interaction.channelId)!!.getMessage(m.id).edit {
- this.embed(fun EmbedBuilder.() {
- color = eb.color
- title = eb.title
- description = eb.description
- fields = eb.fields
- footer = eb.footer
- })
+ this.embed {
+ this.color = eb.color
+ this.title = eb.title
+ this.description = eb.description
+ this.fields = eb.fields
+ this.footer = eb.footer
+ }
}
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/IsAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt
similarity index 88%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/IsAvailableEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt
index b4cdfef..9dbae16 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/IsAvailableEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.timeplanner
+package net.moonleay.lilJudd.buttons.timeplanner
import dev.kord.core.behavior.edit
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
@@ -24,11 +24,11 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.util.EmbedUtil
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.util.EmbedUtil
class IsAvailableEditButton : IEditButton {
override val id: String = "public.edit.btn.timemanagement.available"
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/MaybeAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt
similarity index 88%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/MaybeAvailableEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt
index 23b9c61..01cf792 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/MaybeAvailableEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.timeplanner
+package net.moonleay.lilJudd.buttons.timeplanner
import dev.kord.core.behavior.edit
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
@@ -24,11 +24,11 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.util.EmbedUtil
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.util.EmbedUtil
class MaybeAvailableEditButton : IEditButton {
override val id: String = "public.edit.btn.timemanagement.maybeavailable"
diff --git a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/NotAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt
similarity index 88%
rename from src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/NotAvailableEditButton.kt
rename to src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt
index 0fd5390..ade9557 100644
--- a/src/main/kotlin/net/moonleay/liljudd/buttons/timeplanner/NotAvailableEditButton.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.buttons.timeplanner
+package net.moonleay.lilJudd.buttons.timeplanner
import dev.kord.core.behavior.edit
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
@@ -24,11 +24,11 @@ import dev.kord.core.entity.Guild
import dev.kord.core.entity.User
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.core.entity.interaction.ButtonInteraction
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.buttons.component.IEditButton
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.util.EmbedUtil
+import dev.kord.rest.builder.message.modify.embed
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.buttons.component.IEditButton
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.util.EmbedUtil
class NotAvailableEditButton : IEditButton {
override val id: String = "public.edit.btn.timemanagement.notavailable"
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/CredentialManager.kt b/src/main/kotlin/net/moonleay/lilJudd/data/CredentialManager.kt
similarity index 90%
rename from src/main/kotlin/net/moonleay/liljudd/data/CredentialManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/CredentialManager.kt
index 7a92197..0320d82 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/CredentialManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/CredentialManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data
+package net.moonleay.lilJudd.data
import java.io.*
import java.util.*
@@ -29,8 +29,6 @@ object CredentialManager {
lateinit var dbName: String
lateinit var dbUser: String
lateinit var dbPassword: String
- lateinit var apiDomain: String
- lateinit var apiToken: String
///Load the needed credentials, generate a config if there is none
fun load() {
@@ -53,8 +51,6 @@ object CredentialManager {
dbName = prop.getProperty("dbName")
dbUser = prop.getProperty("dbUser")
dbPassword = prop.getProperty("dbPassword")
- apiDomain = prop.getProperty("apiDomain")
- apiToken = prop.getProperty("apiToken")
input.close()
} catch (e: IOException) {
e.printStackTrace()
@@ -87,8 +83,6 @@ object CredentialManager {
prop.setProperty("dbName", "empty")
prop.setProperty("dbUser", "empty")
prop.setProperty("dbPassword", "empty")
- prop.setProperty("apiDomain", "empty")
- prop.setProperty("apiToken", "empty")
prop.store(output, null)
output.close()
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3Api.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3Api.kt
new file mode 100644
index 0000000..b0192e5
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3Api.kt
@@ -0,0 +1,117 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api
+
+import net.moonleay.lilJudd.data.api.entry.schedule.ModeData
+import net.moonleay.lilJudd.util.TimeUtil
+
+object Splatoon3Api {
+ private fun getRegularMode(timestamp: Long): ModeData {
+ Splatoon3ApiCache.cachedRegularModeData.map { modeData ->
+ val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ if (timestamp in startTime..endTime) {
+ return modeData
+ }
+ }
+ throw Exception("No current mode found")
+ }
+
+ private fun getOpenMode(timestamp: Long): ModeData {
+ Splatoon3ApiCache.cachedCompetitiveOpenModeData.map { modeData ->
+ val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ if (timestamp in startTime..endTime) {
+ return modeData
+ }
+ }
+ throw Exception("No current mode found")
+ }
+
+ private fun getXMode(timestamp: Long): ModeData {
+ Splatoon3ApiCache.cachedXModeData.map { modeData ->
+ val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ if (timestamp in startTime..endTime) {
+ return modeData
+ }
+ }
+ throw Exception("No current mode found")
+ }
+
+ private fun getSeriesMode(timestamp: Long): ModeData {
+ Splatoon3ApiCache.cachedCompetitiveSeriesModeData.map { modeData ->
+ val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ if (timestamp in startTime..endTime) {
+ return modeData
+ }
+ }
+ throw Exception("No current mode found")
+ }
+
+ fun getRegularMapsFormatted(timestamp: Long): String {
+ val modeData = getRegularMode(timestamp)
+ val map1 = modeData.map1!!.name.split(" ")[0]
+ val map2 = modeData.map2!!.name.split(" ")[0]
+ return "R: $map1 & $map2"
+ }
+
+ fun getOpenModeFormatted(timestamp: Long): String {
+ val modeData = getOpenMode(timestamp)
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ val diffStamp = TimeUtil.getTimeDifferenceFormatted(System.currentTimeMillis(), endTime)
+ return "O: ${modeData.ruleSetName} $diffStamp left"
+ }
+
+ fun getOpenMapFormatted(timestamp: Long): String {
+ val modeData = getOpenMode(timestamp)
+ val map1 = modeData.map1!!.name.split(" ")[0]
+ val map2 = modeData.map2!!.name.split(" ")[0]
+ return "O: $map1 & $map2"
+ }
+
+ fun getSeriesModeFormatted(timestamp: Long): String {
+ val modeData = getSeriesMode(timestamp)
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ val diffStamp = TimeUtil.getTimeDifferenceFormatted(System.currentTimeMillis(), endTime)
+ return "S: ${modeData.ruleSetName} $diffStamp left"
+ }
+
+ fun getSeriesMapsFormatted(timestamp: Long): String {
+ val modeData = getSeriesMode(timestamp)
+ val map1 = modeData.map1!!.name.split(" ")[0]
+ val map2 = modeData.map2!!.name.split(" ")[0]
+ return "S: $map1 & $map2"
+ }
+
+ fun getXModeFormatted(timestamp: Long): String {
+ val modeData = getXMode(timestamp)
+ val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
+ val diffStamp = TimeUtil.getTimeDifferenceFormatted(System.currentTimeMillis(), endTime)
+ return "X: ${modeData.ruleSetName} $diffStamp left"
+ }
+
+ fun getXMapFormatted(timestamp: Long): String {
+ val modeData = getXMode(timestamp)
+ val map1 = modeData.map1!!.name.split(" ")[0]
+ val map2 = modeData.map2!!.name.split(" ")[0]
+ return "X: $map1 & $map2"
+ }
+}
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3ApiCache.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3ApiCache.kt
new file mode 100644
index 0000000..714ff1e
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/Splatoon3ApiCache.kt
@@ -0,0 +1,535 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api
+
+import io.ktor.http.*
+import kotlinx.serialization.json.*
+import net.moonleay.lilJudd.data.api.entry.coop.CoopGearData
+import net.moonleay.lilJudd.data.api.entry.schedule.*
+import net.moonleay.lilJudd.data.api.entry.splatfest.SplatfestColor
+import net.moonleay.lilJudd.data.api.entry.splatfest.SplatfestData
+import net.moonleay.lilJudd.data.api.entry.splatfest.SplatfestTeamData
+import net.moonleay.lilJudd.data.api.entry.splatfest.SplatfestTeamResults
+import net.moonleay.lilJudd.data.api.entry.splatnet.BrandData
+import net.moonleay.lilJudd.data.api.entry.splatnet.GearAbilityData
+import net.moonleay.lilJudd.data.api.entry.splatnet.SplatnetItemData
+import net.moonleay.lilJudd.data.api.type.ApiDataType
+import net.moonleay.lilJudd.data.api.type.ApiRequestType
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.NetUtil
+import net.moonleay.liljudd.build.BuildConstants
+
+object Splatoon3ApiCache {
+ private val user_agent =
+ "lilJudd/${BuildConstants.version} (${System.getProperty("os.name")}/${System.getProperty("os.version")}) [contact@moonleay.net]"
+ private val base_url = "https://splatoon3.ink/data/" // Thank god there is an API
+
+ internal var cachedSplatfestData = mutableListOf()
+ internal var cachedMapData = mutableMapOf()
+ internal var cachedRegularModeData = mutableListOf()
+ internal var cachedCompetitiveSeriesModeData = mutableListOf()
+ internal var cachedCompetitiveOpenModeData = mutableListOf()
+ internal var cachedXModeData = mutableListOf()
+ internal var cachedChallengesData = mutableListOf()
+ internal var cachedShiftData = mutableListOf()
+ internal var cachedBigRunShiftData = mutableListOf()
+ internal var cachedCoopRewardsData = mutableListOf()
+ internal var cachedSplatnetItemData = mutableListOf()
+ internal var cachedSplatnetLimitedItemData = mutableListOf()
+ internal lateinit var splatnetShopBrandData: BrandData
+ internal lateinit var splatnetShopNextBrandData: BrandData
+ fun updateData(dataType: ApiDataType, requestType: ApiRequestType) {
+ Logger.out("Updating data for $dataType with USER-AGENT: $user_agent")
+ Logger.out("Reason for update: $requestType")
+ when (dataType) {
+ ApiDataType.SCHEDULES -> {
+ updateScheduleCache(user_agent)
+ }
+
+ ApiDataType.SPLATNETGEAR -> {
+ updateSplatnetGearCache(user_agent)
+ }
+
+ ApiDataType.COOP -> {
+ updateCOOPCache(user_agent)
+ }
+
+ ApiDataType.SPLATFESTS -> {
+ updateSplatfestCache(user_agent)
+ }
+
+ ApiDataType.ALL -> {
+ updateScheduleCache(user_agent)
+ updateSplatnetGearCache(user_agent)
+ updateSplatfestCache(user_agent)
+ updateCOOPCache(user_agent)
+ }
+ }
+ Logger.out("Finished updating data for $dataType")
+ }
+
+ private fun updateSplatnetGearCache(uag: String) {
+ val apiResponse = NetUtil.GETJsonData("${base_url}gear.json", uag)
+ if (apiResponse.startsWith("Error")) {
+ Logger.out("Error getting splatnet data: $apiResponse")
+ return
+ }
+ val json = Json.parseToJsonElement(apiResponse)
+ val pickupBrandData = json.jsonObject["data"]!!.jsonObject["gesotown"]!!.jsonObject["pickupBrand"]!!.jsonObject
+
+ val brand = pickupBrandData["brand"]!!.jsonObject
+ splatnetShopBrandData =
+ BrandData(
+ brand["name"]!!.jsonPrimitive.content,
+ Url(pickupBrandData["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ GearAbilityData(
+ brand["usualGearPower"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ brand["usualGearPower"]!!.jsonObject["desc"]!!.jsonPrimitive.content,
+ Url(brand["usualGearPower"]!!.jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ pickupBrandData["saleEndTime"]!!.jsonPrimitive.content
+ )
+ val nextBrand = pickupBrandData["nextBrand"]!!.jsonObject
+ splatnetShopNextBrandData =
+ BrandData(
+ nextBrand["name"]!!.jsonPrimitive.content,
+ Url(pickupBrandData["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ null,
+ null
+ )
+ cachedSplatnetItemData = mutableListOf()
+ val items = pickupBrandData["brandGears"]!!.jsonArray
+ items.forEach {
+ val obj = it as JsonObject
+ val gear = it["gear"]!!.jsonObject
+ val primaryGearPower = gear["primaryGearPower"]!!.jsonObject
+ val additionalGearPowers = gear["additionalGearPowers"]!!.jsonArray
+ val additionalGearPowersList = mutableListOf()
+ additionalGearPowers.forEach {
+ val ob = it as JsonObject
+ additionalGearPowersList.add(
+ GearAbilityData(
+ ob["name"]!!.jsonPrimitive.content,
+ null,
+ Url(ob["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ )
+ )
+ }
+ cachedSplatnetItemData.add(
+ SplatnetItemData(
+ obj["saleEndTime"]!!.jsonPrimitive.content,
+ obj["price"]!!.jsonPrimitive.int,
+ gear["__typename"]!!.jsonPrimitive.content,
+ gear["name"]!!.jsonPrimitive.content,
+ GearAbilityData(
+ primaryGearPower["name"]!!.jsonPrimitive.content,
+ null,
+ Url(primaryGearPower["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ additionalGearPowersList,
+ Url(gear["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ splatnetShopBrandData
+ )
+ )
+ }
+ Logger.out("Updated gear data")
+
+ val limitedItemData = json.jsonObject["data"]!!.jsonObject["gesotown"]!!.jsonObject["limitedGears"]!!.jsonArray
+ cachedSplatnetLimitedItemData = mutableListOf()
+ limitedItemData.forEach {
+ val obj = it as JsonObject
+ val gear = obj["gear"]!!.jsonObject
+ val additionalGearPowers = gear["additionalGearPowers"]!!.jsonArray
+ val additionalGearPowersList = mutableListOf()
+ additionalGearPowers.forEach {
+ val ob = it as JsonObject
+ additionalGearPowersList.add(
+ GearAbilityData(
+ ob["name"]!!.jsonPrimitive.content,
+ null,
+ Url(ob["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ )
+ )
+ }
+ cachedSplatnetLimitedItemData.add(
+ SplatnetItemData(
+ obj["saleEndTime"]!!.jsonPrimitive.content,
+ obj["price"]!!.jsonPrimitive.int,
+ gear["__typename"]!!.jsonPrimitive.content,
+ gear["name"]!!.jsonPrimitive.content,
+ GearAbilityData(
+ gear["primaryGearPower"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ null,
+ Url(gear["primaryGearPower"]!!.jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ additionalGearPowersList,
+ Url(gear["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ splatnetShopBrandData
+ )
+ )
+ }
+ }
+
+ private fun updateCOOPCache(uag: String) {
+ val apiResponse = NetUtil.GETJsonData("${base_url}coop.json", uag)
+ if (apiResponse.startsWith("Error")) {
+ Logger.out("Error getting coop data: $apiResponse")
+ return
+ }
+ val json = Json.parseToJsonElement(apiResponse)
+ val data = json.jsonObject["data"]!!.jsonObject["coopResult"]!!.jsonObject["monthlyGear"]!!.jsonObject
+ cachedCoopRewardsData = mutableListOf()
+ cachedCoopRewardsData.add(
+ CoopGearData(
+ data["name"]!!.jsonPrimitive.content,
+ Url(data["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ data["__typename"]!!.jsonPrimitive.content
+ )
+ )
+ Logger.out("Updated COOP data")
+ }
+
+ private fun updateScheduleCache(uag: String) {
+ val apiResponse = NetUtil.GETJsonData("${base_url}schedules.json", uag)
+ if (apiResponse.startsWith("Error")) {
+ Logger.out("Error getting schedule data: $apiResponse")
+ return
+ }
+ val json = Json.decodeFromString(apiResponse) as JsonObject
+ val data = json["data"]!!.jsonObject
+
+ val mapList = data["vsStages"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedMapData = mutableMapOf()
+ mapList.forEach {
+ val obj = it as JsonObject
+ val imageURL = Url(obj.jsonObject["originalImage"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ val id = obj.jsonObject["vsStageId"]!!.jsonPrimitive.int
+ cachedMapData[id] = MapData(
+ id,
+ imageURL,
+ it.jsonObject["name"]!!.jsonPrimitive.content
+ )
+ }
+ Logger.out("Updated maplist data")
+
+ val regularMatches = data["regularSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedRegularModeData = mutableListOf()
+ regularMatches.forEach {
+ val obj = it as JsonObject
+ val setting = obj["regularMatchSetting"]!!.jsonObject
+ cachedRegularModeData.add(
+ ModeData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ setting["__typename"]!!.jsonPrimitive.content,
+ cachedMapData[setting["vsStages"]!!.jsonArray[0].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ cachedMapData[setting["vsStages"]!!.jsonArray[1].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ setting["vsRule"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ setting["vsRule"]!!.jsonObject["rule"]!!.jsonPrimitive.content,
+ "TURF_WAR"
+ )
+ )
+ }
+ Logger.out("Updated Regular match data")
+
+ val compMatches = data["bankaraSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedCompetitiveSeriesModeData = mutableListOf()
+ cachedCompetitiveOpenModeData = mutableListOf()
+ compMatches.forEach {
+ val obj = it as JsonObject
+ val setting = obj["bankaraMatchSettings"]!!.jsonArray
+ setting.forEach {
+ val ob = it as JsonObject
+ val mode = ob["bankaraMode"]!!.jsonPrimitive.content
+ if (mode == "CHALLENGE") {
+ cachedCompetitiveSeriesModeData.add(
+ ModeData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ ob["__typename"]!!.jsonPrimitive.content,
+ cachedMapData[ob["vsStages"]!!.jsonArray[0].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ cachedMapData[ob["vsStages"]!!.jsonArray[1].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ ob["vsRule"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ ob["vsRule"]!!.jsonObject["rule"]!!.jsonPrimitive.content,
+ mode
+ )
+ )
+ } else if (mode == "OPEN") {
+ cachedCompetitiveOpenModeData.add(
+ ModeData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ ob["__typename"]!!.jsonPrimitive.content,
+ cachedMapData[ob["vsStages"]!!.jsonArray[0].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ cachedMapData[ob["vsStages"]!!.jsonArray[1].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ ob["vsRule"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ ob["vsRule"]!!.jsonObject["rule"]!!.jsonPrimitive.content,
+ mode
+ )
+ )
+ }
+ }
+ }
+ Logger.out("Updated Competitive match data")
+
+ val xMatches = data["xSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedXModeData = mutableListOf()
+ xMatches.forEach {
+ val obj = it as JsonObject
+ val setting = obj["xMatchSetting"]!!.jsonObject
+ cachedXModeData.add(
+ ModeData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ setting["__typename"]!!.jsonPrimitive.content,
+ cachedMapData[setting["vsStages"]!!.jsonArray[0].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ cachedMapData[setting["vsStages"]!!.jsonArray[1].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ setting["vsRule"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ setting["vsRule"]!!.jsonObject["rule"]!!.jsonPrimitive.content,
+ "X"
+ )
+ )
+ }
+ Logger.out("Updated X match data")
+
+ val challengeData = data["eventSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedChallengesData = mutableListOf()
+ challengeData.forEach {
+ val obj = it as JsonObject
+ val tpd = obj["timePeriods"]!!.jsonArray
+ val setting = obj["leagueMatchSetting"]!!.jsonObject
+ val event = setting["leagueMatchEvent"]!!.jsonObject
+ cachedChallengesData.add(
+ ChallengeModeData(
+ event["leagueMatchEventId"]!!.jsonPrimitive.content,
+ event["name"]!!.jsonPrimitive.content,
+ event["desc"]!!.jsonPrimitive.content,
+ event["regulation"]!!.jsonPrimitive.content,
+ cachedMapData[setting["vsStages"]!!.jsonArray[0].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ cachedMapData[setting["vsStages"]!!.jsonArray[1].jsonObject["vsStageId"]!!.jsonPrimitive.int],
+ setting["__typename"]!!.jsonPrimitive.content,
+ setting["vsRule"]!!.jsonObject["rule"]!!.jsonPrimitive.content,
+ setting["vsRule"]!!.jsonObject["name"]!!.jsonPrimitive.content,
+ TimePeriodData(
+ tpd[0].jsonObject["startTime"]!!.jsonPrimitive.content,
+ tpd[0].jsonObject["endTime"]!!.jsonPrimitive.content
+ ),
+ TimePeriodData(
+ tpd[1].jsonObject["startTime"]!!.jsonPrimitive.content,
+ tpd[1].jsonObject["endTime"]!!.jsonPrimitive.content
+ ),
+ TimePeriodData(
+ tpd[2].jsonObject["startTime"]!!.jsonPrimitive.content,
+ tpd[2].jsonObject["endTime"]!!.jsonPrimitive.content
+ )
+ )
+ )
+ }
+ Logger.out("Updated Challenge data")
+
+ val shiftData = data["coopGroupingSchedule"]!!.jsonObject["regularSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedShiftData = mutableListOf()
+ shiftData.forEach {
+ val obj = it as JsonObject
+ val setting = obj["setting"]!!.jsonObject
+ val stage = setting["coopStage"]!!.jsonObject
+ val weapons = setting["weapons"]!!.jsonArray
+ cachedShiftData.add(
+ ShiftData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ obj["__splatoon3ink_king_salmonid_guess"]!!.jsonPrimitive.content,
+ setting["__typename"]!!.jsonPrimitive.content,
+ stage["name"]!!.jsonPrimitive.content,
+ Url(stage["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ WeaponData(
+ weapons[0].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[0].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[1].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[1].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[2].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[2].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[3].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[3].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ )
+ )
+ )
+ }
+
+ val bigRunData = data["coopGroupingSchedule"]!!.jsonObject["bigRunSchedules"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedBigRunShiftData = mutableListOf()
+ bigRunData.forEach {
+ val obj = it as JsonObject
+ val setting = obj["setting"]!!.jsonObject
+ val stage = setting["coopStage"]!!.jsonObject
+ val weapons = setting["weapons"]!!.jsonArray
+ cachedBigRunShiftData.add(
+ ShiftData(
+ obj["startTime"]!!.jsonPrimitive.content,
+ obj["endTime"]!!.jsonPrimitive.content,
+ obj["__splatoon3ink_king_salmonid_guess"]!!.jsonPrimitive.content,
+ setting["__typename"]!!.jsonPrimitive.content,
+ stage["name"]!!.jsonPrimitive.content,
+ Url(stage["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ WeaponData(
+ weapons[0].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[0].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[1].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[1].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[2].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[2].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ ),
+ WeaponData(
+ weapons[3].jsonObject["name"]!!.jsonPrimitive.content,
+ Url(weapons[3].jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content)
+ )
+ )
+ )
+ }
+ Logger.out("Updated big run data")
+
+ Logger.out("Updated all Schedules")
+ }
+
+ private fun updateSplatfestCache(uag: String) {
+ val apiResponse = NetUtil.GETJsonData("${base_url}festivals.json", uag)
+ if (apiResponse.startsWith("Error")) {
+ Logger.out("Error getting splatfest data: $apiResponse")
+ return
+ }
+ val json = Json.decodeFromString(apiResponse) as JsonObject
+ val festivals = json["US"]!!.jsonObject["data"]!!.jsonObject["festRecords"]!!.jsonObject["nodes"]!!.jsonArray
+ cachedSplatfestData = mutableListOf()
+ festivals.forEach {
+ val fest = it as JsonObject
+ val teams = fest.jsonObject["teams"]!!.jsonArray
+ val team1 = teams[0].jsonObject
+ val team1Color = team1["color"]!!.jsonObject
+ var team1Result: JsonObject? = null
+ if (team1["result"] !is JsonNull) {
+ team1Result = team1["result"]!!.jsonObject
+ }
+ val team2 = teams[1].jsonObject
+ val team2Color = team2["color"]!!.jsonObject
+ var team2Result: JsonObject? = null
+ if (team2["result"] !is JsonNull) {
+ team2Result = team2["result"]!!.jsonObject
+ }
+ val team3 = teams[2].jsonObject
+ val team3Color = team3["color"]!!.jsonObject
+ var team3Result: JsonObject? = null
+ if (team3["result"] !is JsonNull) {
+ team3Result = team3["result"]!!.jsonObject
+ }
+ cachedSplatfestData.add(
+ SplatfestData(
+ fest.jsonObject["id"]!!.jsonPrimitive.content,
+ fest.jsonObject["state"]!!.jsonPrimitive.content,
+ fest.jsonObject["startTime"]!!.jsonPrimitive.content,
+ fest.jsonObject["endTime"]!!.jsonPrimitive.content,
+ fest.jsonObject["title"]!!.jsonPrimitive.content,
+ Url(fest.jsonObject["image"]!!.jsonObject["url"]!!.jsonPrimitive.content),
+ SplatfestTeamData(
+ team1["teamName"]!!.jsonPrimitive.content,
+ SplatfestColor(
+ team1Color["a"]!!.jsonPrimitive.int,
+ team1Color["b"]!!.jsonPrimitive.double,
+ team1Color["g"]!!.jsonPrimitive.double,
+ team1Color["r"]!!.jsonPrimitive.double
+ ),
+ if (team1Result.isNullOrEmpty() || team1Result["tricolorContributionRatio"]!!.jsonPrimitive.doubleOrNull == null)
+ null
+ else SplatfestTeamResults(
+ team1Result["isWinner"]!!.jsonPrimitive.boolean,
+ team1Result["horagaiRatio"]!!.jsonPrimitive.double,
+ team1Result["isHoragaiRatioTop"]!!.jsonPrimitive.boolean,
+ team1Result["voteRatio"]!!.jsonPrimitive.double,
+ team1Result["isVoteRatioTop"]!!.jsonPrimitive.boolean,
+ team1Result["regularContributionRatio"]!!.jsonPrimitive.double,
+ team1Result["isRegularContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team1Result["challengeContributionRatio"]!!.jsonPrimitive.double,
+ team1Result["isChallengeContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team1Result["tricolorContributionRatio"]!!.jsonPrimitive.double,
+ team1Result["isTricolorContributionRatioTop"]!!.jsonPrimitive.boolean,
+ )
+ ),
+ SplatfestTeamData(
+ team2["teamName"]!!.jsonPrimitive.content,
+ SplatfestColor(
+ team2Color["a"]!!.jsonPrimitive.int,
+ team2Color["b"]!!.jsonPrimitive.double,
+ team2Color["g"]!!.jsonPrimitive.double,
+ team2Color["r"]!!.jsonPrimitive.double
+ ),
+ if (team2Result.isNullOrEmpty() || team2Result["tricolorContributionRatio"]!!.jsonPrimitive.doubleOrNull == null)
+ null
+ else SplatfestTeamResults(
+ team2Result["isWinner"]!!.jsonPrimitive.boolean,
+ team2Result["horagaiRatio"]!!.jsonPrimitive.double,
+ team2Result["isHoragaiRatioTop"]!!.jsonPrimitive.boolean,
+ team2Result["voteRatio"]!!.jsonPrimitive.double,
+ team2Result["isVoteRatioTop"]!!.jsonPrimitive.boolean,
+ team2Result["regularContributionRatio"]!!.jsonPrimitive.double,
+ team2Result["isRegularContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team2Result["challengeContributionRatio"]!!.jsonPrimitive.double,
+ team2Result["isChallengeContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team2Result["tricolorContributionRatio"]!!.jsonPrimitive.double,
+ team2Result["isTricolorContributionRatioTop"]!!.jsonPrimitive.boolean,
+ )
+ ),
+ SplatfestTeamData(
+ team3["teamName"]!!.jsonPrimitive.content,
+ SplatfestColor(
+ team3Color["a"]!!.jsonPrimitive.int,
+ team3Color["b"]!!.jsonPrimitive.double,
+ team3Color["g"]!!.jsonPrimitive.double,
+ team3Color["r"]!!.jsonPrimitive.double
+ ),
+ if (team3Result.isNullOrEmpty() || team3Result["tricolorContributionRatio"]!!.jsonPrimitive.doubleOrNull == null)
+ null
+ else SplatfestTeamResults(
+ team3Result["isWinner"]!!.jsonPrimitive.boolean,
+ team3Result["horagaiRatio"]!!.jsonPrimitive.double,
+ team3Result["isHoragaiRatioTop"]!!.jsonPrimitive.boolean,
+ team3Result["voteRatio"]!!.jsonPrimitive.double,
+ team3Result["isVoteRatioTop"]!!.jsonPrimitive.boolean,
+ team3Result["regularContributionRatio"]!!.jsonPrimitive.double,
+ team3Result["isRegularContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team3Result["challengeContributionRatio"]!!.jsonPrimitive.double,
+ team3Result["isChallengeContributionRatioTop"]!!.jsonPrimitive.boolean,
+ team3Result["tricolorContributionRatio"]!!.jsonPrimitive.double,
+ team3Result["isTricolorContributionRatioTop"]!!.jsonPrimitive.boolean,
+ )
+ ),
+ )
+ )
+ }
+ Logger.out("Updated Splatfest data")
+ }
+}
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/coop/CoopGearData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/coop/CoopGearData.kt
new file mode 100644
index 0000000..4f46642
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/coop/CoopGearData.kt
@@ -0,0 +1,28 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api.entry.coop
+
+import io.ktor.http.*
+
+data class CoopGearData(
+ val name: String,
+ val image: Url,
+ val __typename: String,
+
+ )
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchEvent.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ChallengeModeData.kt
similarity index 61%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchEvent.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ChallengeModeData.kt
index 494703b..c288fe9 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchEvent.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ChallengeModeData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,24 +16,19 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.schedule
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class LeagueMatchEvent(
- @SerialName("desc")
- val desc: String,
- @SerialName("id")
- val id: String,
- @SerialName("leagueMatchEventId")
+data class ChallengeModeData(
val leagueMatchEventId: String,
- @SerialName("name")
val name: String,
- @SerialName("regulation")
+ val description: String,
val regulation: String,
- @SerialName("regulationUrl")
- val regulationUrl: String? // is null
+ val map1: MapData?,
+ val map2: MapData?,
+ val __typename: String,
+ val ruleSet: String,
+ val ruleSetName: String,
+ val timePeriod1: TimePeriodData,
+ val timePeriod2: TimePeriodData,
+ val timePeriod3: TimePeriodData,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Image.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/MapData.kt
similarity index 72%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Image.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/MapData.kt
index 9543b8a..422783c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Image.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/MapData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.schedule
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Image(
- @SerialName("url")
- val url: String
+data class MapData(
+ val stageID: Int,
+ val image: Url,
+ val name: String,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TimePeriod.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ModeData.kt
similarity index 70%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TimePeriod.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ModeData.kt
index d86de17..8295a1a 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TimePeriod.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ModeData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,16 +16,15 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.schedule
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class TimePeriod(
- @SerialName("endTime")
+data class ModeData(
+ val startTime: String,
val endTime: String,
- @SerialName("startTime")
- val startTime: String
+ val matchType: String,
+ val map1: MapData?,
+ val map2: MapData?,
+ val ruleSetName: String,
+ val ruleSet: String,
+ val mode: String,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestNode.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ShiftData.kt
similarity index 63%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestNode.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ShiftData.kt
index 8e869a9..a4d28ae 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestNode.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/ShiftData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,18 +16,19 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.schedule
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class FestNode(
- @SerialName("endTime")
+data class ShiftData(
+ val startTime: String,
val endTime: String,
- @SerialName("festMatchSettings")
- val festMatchSettings: FestMatchSettingX?,
- @SerialName("startTime")
- val startTime: String
+ val __splatoon3ink_king_salmonid_guess: String,
+ val __typename: String,
+ val stageName: String,
+ val image: Url,
+ val weapon1: WeaponData,
+ val weapon2: WeaponData,
+ val weapon3: WeaponData,
+ val weapon4: WeaponData,
)
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/TimePeriodData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/TimePeriodData.kt
new file mode 100644
index 0000000..53edb96
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/TimePeriodData.kt
@@ -0,0 +1,24 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api.entry.schedule
+
+data class TimePeriodData(
+ val startTime: String,
+ val endTime: String,
+)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/UserIcon.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/WeaponData.kt
similarity index 72%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/UserIcon.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/WeaponData.kt
index 673f73a..997a24b 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/UserIcon.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/schedule/WeaponData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,11 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.schedule
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class UserIcon(
- @SerialName("url")
- val url: String
+data class WeaponData(
+ val name: String,
+ val image: Url,
)
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestColor.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestColor.kt
new file mode 100644
index 0000000..391ccb3
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestColor.kt
@@ -0,0 +1,26 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api.entry.splatfest
+
+data class SplatfestColor(
+ val a: Int,
+ val b: Double,
+ val g: Double,
+ val r: Double,
+)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Team.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestData.kt
similarity index 66%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Team.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestData.kt
index 8043c5d..f52b9b4 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Team.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,18 +16,18 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.splatfest
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Team(
- @SerialName("color")
- val color: Color,
- @SerialName("id")
+data class SplatfestData(
val id: String,
-// @SerialName("myVoteState")
-// val myVoteState: Any?
+ val state: String,
+ val startTime: String,
+ val endTime: String,
+ val title: String,
+ val image: Url,
+ val team1: SplatfestTeamData,
+ val team2: SplatfestTeamData,
+ val team3: SplatfestTeamData,
)
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamData.kt
new file mode 100644
index 0000000..9ea2e72
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamData.kt
@@ -0,0 +1,25 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api.entry.splatfest
+
+data class SplatfestTeamData(
+ val teamName: String,
+ val color: SplatfestColor,
+ val results: SplatfestTeamResults?,
+)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Boss.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamResults.kt
similarity index 59%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Boss.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamResults.kt
index abf1858..4888adc 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Boss.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatfest/SplatfestTeamResults.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,16 +16,18 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.splatfest
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Boss(
- @SerialName("id")
- val id: String,
- @SerialName("name")
- val name: String
+data class SplatfestTeamResults(
+ val isWinner: Boolean,
+ val horagaiRatio: Double,
+ val horagaiRatioTop: Boolean,
+ val voteRatio: Double,
+ val voteRatioTop: Boolean,
+ val regularRatio: Double,
+ val regularRatioTop: Boolean,
+ val challengeRatio: Double,
+ val challengeRatioTop: Boolean,
+ val tricolorRatio: Double,
+ val tricolorRatioTop: Boolean,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BannerImage.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/BrandData.kt
similarity index 72%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BannerImage.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/BrandData.kt
index 245536a..6781172 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BannerImage.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/BrandData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,13 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.splatnet
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class BannerImage(
- @SerialName("url")
- val url: String,
+data class BrandData(
+ val name: String,
+ val image: Url,
+ val usualGearPower: GearAbilityData?,
+ val saleEndTime: String?,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/OriginalImage.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/GearAbilityData.kt
similarity index 72%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/OriginalImage.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/GearAbilityData.kt
index 0393f71..713d946 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/OriginalImage.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/GearAbilityData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.splatnet
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class OriginalImage(
- @SerialName("url")
- val url: String
+data class GearAbilityData(
+ val name: String,
+ val description: String?,
+ val image: Url,
)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsRule.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/SplatnetItemData.kt
similarity index 66%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsRule.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/SplatnetItemData.kt
index bddb5a5..43df20b 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsRule.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/entry/splatnet/SplatnetItemData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,18 +16,17 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.entry.splatnet
+import io.ktor.http.*
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class VsRule(
- @SerialName("id")
- val id: String,
- @SerialName("name")
+data class SplatnetItemData(
+ val saleEndTime: String,
+ val price: Int,
+ val typeName: String,
val name: String,
- @SerialName("rule")
- val rule: String
+ val primaryGearPower: GearAbilityData,
+ val additionalGearPowers: List,
+ val image: Url,
+ val brand: BrandData,
)
diff --git a/src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiDataType.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiDataType.kt
new file mode 100644
index 0000000..7123b0d
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiDataType.kt
@@ -0,0 +1,27 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.data.api.type
+
+enum class ApiDataType {
+ SCHEDULES,
+ SPLATNETGEAR,
+ COOP,
+ SPLATFESTS,
+ ALL
+}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraSchedules.kt b/src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiRequestType.kt
similarity index 65%
rename from src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraSchedules.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiRequestType.kt
index 7f6cd90..da20371 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraSchedules.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/api/type/ApiRequestType.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,11 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
+package net.moonleay.lilJudd.data.api.type
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class BankaraSchedules(
- @SerialName("nodes")
- val nodes: List
-)
+enum class ApiRequestType(val nameToDisplay: String) {
+ AUTOMATIC_CACHE_UPDATE("automatic request to update the cache"),
+ AUTOMATIC_CACHE_CREATION_AT_STARTUP("automatic request to create cache at startup"),
+ MANUAL("manual request"),
+ DEBUG("debug request")
+}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/DB.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/DB.kt
similarity index 83%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/DB.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/DB.kt
index 2475f28..7c58ea0 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/DB.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/DB.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,13 +16,13 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database
+package net.moonleay.lilJudd.data.database
-import net.moonleay.liljudd.data.database.tables.MatchPlanningData
-import net.moonleay.liljudd.data.database.tables.PlanningNotifierRoles
-import net.moonleay.liljudd.data.database.tables.TimePlanningChannels
-import net.moonleay.liljudd.data.database.tables.TimePlanningMessages
+import net.moonleay.lilJudd.data.database.tables.MatchPlanningData
+import net.moonleay.lilJudd.data.database.tables.PlanningNotifierRoles
+import net.moonleay.lilJudd.data.database.tables.TimePlanningChannels
+import net.moonleay.lilJudd.data.database.tables.TimePlanningMessages
import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils
import org.jetbrains.exposed.sql.transactions.transaction
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/MatchPlanningDataData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/MatchPlanningDataData.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/entry/MatchPlanningDataData.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/entry/MatchPlanningDataData.kt
index 77bfcc8..b19c5e7 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/MatchPlanningDataData.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/MatchPlanningDataData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.entry
+package net.moonleay.lilJudd.data.database.entry
data class MatchPlanningDataData(
val id: Int,
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/PlanningNotifierRolesData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/PlanningNotifierRolesData.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/entry/PlanningNotifierRolesData.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/entry/PlanningNotifierRolesData.kt
index b6d0abf..c58130a 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/PlanningNotifierRolesData.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/PlanningNotifierRolesData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.entry
+package net.moonleay.lilJudd.data.database.entry
data class PlanningNotifierRolesData(
val id: Int, // The id of the entry
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningChannelsData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningChannelsData.kt
similarity index 90%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningChannelsData.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningChannelsData.kt
index 0f93b9e..7edd496 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningChannelsData.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningChannelsData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.entry
+package net.moonleay.lilJudd.data.database.entry
data class TimePlanningChannelsData(
val id: Int,
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningMessagesData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningMessagesData.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningMessagesData.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningMessagesData.kt
index c1192fc..3126e2c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/entry/TimePlanningMessagesData.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/entry/TimePlanningMessagesData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.entry
+package net.moonleay.lilJudd.data.database.entry
data class TimePlanningMessagesData(
val id: Int, // The id of the entry
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/MatchPlanningDataRepository.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/MatchPlanningDataRepository.kt
similarity index 79%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/repository/MatchPlanningDataRepository.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/repository/MatchPlanningDataRepository.kt
index 5c93b43..84a1e66 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/MatchPlanningDataRepository.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/MatchPlanningDataRepository.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,15 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.repository
+package net.moonleay.lilJudd.data.database.repository
-import net.moonleay.liljudd.data.database.entry.MatchPlanningDataData
-import net.moonleay.liljudd.data.database.tables.MatchPlanningData
+import net.moonleay.lilJudd.data.database.entry.MatchPlanningDataData
+import net.moonleay.lilJudd.data.database.tables.MatchPlanningData
+import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
-import org.jetbrains.exposed.sql.and
-import org.jetbrains.exposed.sql.deleteWhere
-import org.jetbrains.exposed.sql.insert
-import org.jetbrains.exposed.sql.selectAll
import org.jetbrains.exposed.sql.transactions.transaction
object MatchPlanningDataRepository {
@@ -54,7 +51,7 @@ object MatchPlanningDataRepository {
fun get(id: Int): MatchPlanningDataData? =
transaction {
- MatchPlanningData.selectAll().where { MatchPlanningData.id eq id }.firstOrNull()?.let {
+ MatchPlanningData.select { MatchPlanningData.id eq id }.firstOrNull()?.let {
MatchPlanningDataData(
it[MatchPlanningData.id],
it[MatchPlanningData.serverid],
@@ -72,7 +69,7 @@ object MatchPlanningDataRepository {
fun getFromMessageInChannelInServer(messageID: Long, channelID: Long, serverID: Long): MatchPlanningDataData? =
transaction {
- MatchPlanningData.selectAll().where {
+ MatchPlanningData.select {
MatchPlanningData.messageid eq (messageID) and (
MatchPlanningData.serverid eq (serverID)) and (
MatchPlanningData.channelid eq (channelID))
@@ -101,15 +98,15 @@ object MatchPlanningDataRepository {
fun write(data: MatchPlanningDataData): Int =
transaction {
MatchPlanningData.insert {
- it[serverid] = data.serverID
- it[channelid] = data.channelID
- it[matchtype] = data.matchType
- it[registererid] = data.registererID
- it[roleid] = data.roleID
- it[opponentName] = data.opponentName
- it[messageid] = data.messageID
- it[timestamp] = data.timestamp
- it[jobstr] = data.jobString
+ it[MatchPlanningData.serverid] = data.serverID
+ it[MatchPlanningData.channelid] = data.channelID
+ it[MatchPlanningData.matchtype] = data.matchType
+ it[MatchPlanningData.registererid] = data.registererID
+ it[MatchPlanningData.roleid] = data.roleID
+ it[MatchPlanningData.opponentName] = data.opponentName
+ it[MatchPlanningData.messageid] = data.messageID
+ it[MatchPlanningData.timestamp] = data.timestamp
+ it[MatchPlanningData.jobstr] = data.jobString
} get MatchPlanningData.id
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/PlanningNotifierRolesRepository.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/PlanningNotifierRolesRepository.kt
similarity index 71%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/repository/PlanningNotifierRolesRepository.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/repository/PlanningNotifierRolesRepository.kt
index 3333471..4059e70 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/PlanningNotifierRolesRepository.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/PlanningNotifierRolesRepository.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,15 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.repository
+package net.moonleay.lilJudd.data.database.repository
-import net.moonleay.liljudd.data.database.entry.PlanningNotifierRolesData
-import net.moonleay.liljudd.data.database.tables.PlanningNotifierRoles
+import net.moonleay.lilJudd.data.database.entry.PlanningNotifierRolesData
+import net.moonleay.lilJudd.data.database.tables.PlanningNotifierRoles
+import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
-import org.jetbrains.exposed.sql.and
-import org.jetbrains.exposed.sql.deleteWhere
-import org.jetbrains.exposed.sql.insert
-import org.jetbrains.exposed.sql.selectAll
import org.jetbrains.exposed.sql.transactions.transaction
object PlanningNotifierRolesRepository {
@@ -49,7 +46,9 @@ object PlanningNotifierRolesRepository {
fun getForChannel(channelID: Long): PlanningNotifierRolesData? =
transaction {
- PlanningNotifierRoles.selectAll().where { PlanningNotifierRoles.channelid eq channelID }.firstOrNull()?.let {
+ PlanningNotifierRoles.select {
+ PlanningNotifierRoles.channelid eq channelID
+ }.firstOrNull()?.let {
PlanningNotifierRolesData(
it[PlanningNotifierRoles.id],
it[PlanningNotifierRoles.serverid],
@@ -62,9 +61,9 @@ object PlanningNotifierRolesRepository {
fun getForChannelInServer(channelID: Long, serverID: Long): PlanningNotifierRolesData? =
transaction {
- PlanningNotifierRoles.selectAll()
- .where { PlanningNotifierRoles.channelid eq channelID and (PlanningNotifierRoles.serverid eq serverID) }
- .firstOrNull()?.let {
+ PlanningNotifierRoles.select {
+ PlanningNotifierRoles.channelid eq channelID and (PlanningNotifierRoles.serverid eq serverID)
+ }.firstOrNull()?.let {
PlanningNotifierRolesData(
it[PlanningNotifierRoles.id],
it[PlanningNotifierRoles.serverid],
@@ -77,23 +76,22 @@ object PlanningNotifierRolesRepository {
fun existsInChannel(channelID: Long): Boolean =
transaction {
- PlanningNotifierRoles.selectAll().where { PlanningNotifierRoles.channelid eq channelID }.count() > 0
+ PlanningNotifierRoles.select { PlanningNotifierRoles.channelid eq channelID }.count() > 0
}
fun existsInChannelFromSever(channelID: Long, serverID: Long): Boolean =
transaction {
- PlanningNotifierRoles.selectAll()
- .where { PlanningNotifierRoles.channelid eq channelID and (PlanningNotifierRoles.serverid eq serverID) }
+ PlanningNotifierRoles.select { PlanningNotifierRoles.channelid eq channelID and (PlanningNotifierRoles.serverid eq serverID) }
.count() > 0
}
fun write(data: PlanningNotifierRolesData) {
transaction {
PlanningNotifierRoles.insert {
- it[serverid] = data.serverID
- it[channelid] = data.channelID
- it[hastimeroleid] = data.hasTimeRoleID
- it[wantstobenotifiedid] = data.wantsToBeNotifiedID
+ it[PlanningNotifierRoles.serverid] = data.serverID
+ it[PlanningNotifierRoles.channelid] = data.channelID
+ it[PlanningNotifierRoles.hastimeroleid] = data.hasTimeRoleID
+ it[PlanningNotifierRoles.wantstobenotifiedid] = data.wantsToBeNotifiedID
} get PlanningNotifierRoles.id
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningChannelsRepository.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningChannelsRepository.kt
similarity index 72%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningChannelsRepository.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningChannelsRepository.kt
index f809420..f5fd171 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningChannelsRepository.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningChannelsRepository.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,15 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.repository
+package net.moonleay.lilJudd.data.database.repository
-import net.moonleay.liljudd.data.database.entry.TimePlanningChannelsData
-import net.moonleay.liljudd.data.database.tables.TimePlanningChannels
+import net.moonleay.lilJudd.data.database.entry.TimePlanningChannelsData
+import net.moonleay.lilJudd.data.database.tables.TimePlanningChannels
+import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
-import org.jetbrains.exposed.sql.and
-import org.jetbrains.exposed.sql.deleteWhere
-import org.jetbrains.exposed.sql.insert
-import org.jetbrains.exposed.sql.selectAll
import org.jetbrains.exposed.sql.transactions.transaction
object TimePlanningChannelsRepository {
@@ -46,8 +43,7 @@ object TimePlanningChannelsRepository {
fun exists(channelID: Long, serverID: Long): Boolean =
transaction {
- TimePlanningChannels.selectAll()
- .where { TimePlanningChannels.channelid eq channelID and (TimePlanningChannels.serverid eq serverID) }
+ TimePlanningChannels.select { TimePlanningChannels.channelid eq channelID and (TimePlanningChannels.serverid eq serverID) }
.firstOrNull() != null
}
@@ -59,15 +55,15 @@ object TimePlanningChannelsRepository {
fun deleteFromChannelInServer(channelID: Long, serverID: Long) {
transaction {
- TimePlanningChannels.deleteWhere { channelid eq channelID and (serverid eq serverID) }
+ TimePlanningChannels.deleteWhere { TimePlanningChannels.channelid eq channelID and (TimePlanningChannels.serverid eq serverID) }
}
}
fun write(data: TimePlanningChannelsData): Int =
transaction {
TimePlanningChannels.insert {
- it[serverid] = data.serverID
- it[channelid] = data.channelID
+ it[TimePlanningChannels.serverid] = data.serverID
+ it[TimePlanningChannels.channelid] = data.channelID
} get TimePlanningChannels.id
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningMessagesRepository.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningMessagesRepository.kt
similarity index 80%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningMessagesRepository.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningMessagesRepository.kt
index 4c92a08..780a939 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/repository/TimePlanningMessagesRepository.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/repository/TimePlanningMessagesRepository.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,13 +16,13 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.repository
+package net.moonleay.lilJudd.data.database.repository
-import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
-import net.moonleay.liljudd.data.database.tables.TimePlanningMessages
+import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
+import net.moonleay.lilJudd.data.database.tables.TimePlanningMessages
import org.jetbrains.exposed.sql.and
import org.jetbrains.exposed.sql.insert
-import org.jetbrains.exposed.sql.selectAll
+import org.jetbrains.exposed.sql.select
import org.jetbrains.exposed.sql.transactions.transaction
object TimePlanningMessagesRepository {
@@ -40,7 +40,9 @@ object TimePlanningMessagesRepository {
fun getWeek(stamp: Long): List {
val dataList = mutableListOf()
transaction {
- for (pnr in TimePlanningMessages.selectAll().where { TimePlanningMessages.weekstamp eq (stamp) }) {
+ for (pnr in TimePlanningMessages.select {
+ TimePlanningMessages.weekstamp eq (stamp)
+ }) {
dataList.add(
TimePlanningMessagesData(
pnr[TimePlanningMessages.id],
@@ -57,8 +59,9 @@ object TimePlanningMessagesRepository {
fun getWeekInChannel(stamp: Long, channelID: Long): TimePlanningMessagesData? =
transaction {
- TimePlanningMessages.selectAll()
- .where { TimePlanningMessages.weekstamp eq (stamp) and (TimePlanningMessages.channelid eq channelID) }.firstOrNull()?.let {
+ TimePlanningMessages.select {
+ TimePlanningMessages.weekstamp eq (stamp) and (TimePlanningMessages.channelid eq channelID)
+ }.firstOrNull()?.let {
TimePlanningMessagesData(
it[TimePlanningMessages.id],
it[TimePlanningMessages.serverid],
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/MatchPlanningData.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/MatchPlanningData.kt
similarity index 93%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/tables/MatchPlanningData.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/tables/MatchPlanningData.kt
index 1ba4ae3..391b3e8 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/MatchPlanningData.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/MatchPlanningData.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.tables
+package net.moonleay.lilJudd.data.database.tables
import org.jetbrains.exposed.sql.Table
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/PlanningNotifierRoles.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/PlanningNotifierRoles.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/tables/PlanningNotifierRoles.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/tables/PlanningNotifierRoles.kt
index 0e44813..66fe906 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/PlanningNotifierRoles.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/PlanningNotifierRoles.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.tables
+package net.moonleay.lilJudd.data.database.tables
import org.jetbrains.exposed.sql.Table
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningChannels.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningChannels.kt
similarity index 91%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningChannels.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningChannels.kt
index 7b81b0b..d3b31e3 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningChannels.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningChannels.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.tables
+package net.moonleay.lilJudd.data.database.tables
import org.jetbrains.exposed.sql.Table
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningMessages.kt b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningMessages.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningMessages.kt
rename to src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningMessages.kt
index f7061ac..dd48838 100644
--- a/src/main/kotlin/net/moonleay/liljudd/data/database/tables/TimePlanningMessages.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/data/database/tables/TimePlanningMessages.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.data.database.tables
+package net.moonleay.lilJudd.data.database.tables
import org.jetbrains.exposed.sql.Table
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/FeatureManageExtension.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/FeatureManageExtension.kt
similarity index 56%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/FeatureManageExtension.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/FeatureManageExtension.kt
index 309e433..e09786c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/FeatureManageExtension.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/FeatureManageExtension.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,22 +16,22 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions
+package net.moonleay.lilJudd.extensions
import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
import com.kotlindiscord.kord.extensions.commands.converters.impl.channel
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
+import com.kotlindiscord.kord.extensions.types.respond
import com.kotlindiscord.kord.extensions.utils.hasPermission
import dev.kord.common.entity.Permission
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.extensions.component.EnableOrDisable
-import net.moonleay.liljudd.features.component.FeatureEnum
-import net.moonleay.liljudd.features.component.FeatureManager
-import net.moonleay.liljudd.util.EmbedColor
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
+import net.moonleay.lilJudd.extensions.component.EnableOrDisable
+import net.moonleay.lilJudd.features.component.FeatureEnum
+import net.moonleay.lilJudd.features.component.FeatureManager
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
class FeatureManageExtension : Extension() {
@@ -49,16 +49,14 @@ class FeatureManageExtension : Extension() {
val u = this.user
if (!u.asMember(this.guild!!.id).hasPermission(Permission.Administrator)) {
this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "401: Not Authorized"
- this.description =
- "You cannot edit features, as you don't have the Administrator permission."
- this.footer {
- this.icon = u.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(u)
- }
- }
+ embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.ERROR,
+ "403: Forbidden",
+ "You cannot edit features, as you don't have the Administrator permission.",
+ u.asUser().username + "#" + u.asUser().discriminator
+ )
+ )
}
return@action
}
@@ -70,45 +68,26 @@ class FeatureManageExtension : Extension() {
val f = FeatureManager.getFeature(args.feature)
if (f == null) {
this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "404: Not Found"
- this.description = "The feature you are trying to edit does not exist."
- this.footer {
- this.icon = u.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(u)
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.ERROR,
+ "404: Not Found",
+ "The feature you are trying to edit does not exist.",
+ u.asUser().username + "#" + u.asUser().discriminator
+ )
+ )
}
return@action
}
if (this.arguments.setStatus == EnableOrDisable.ENABLE) {
- val enabled = f.enable(u, gID, cID, channel, args)
this.respond {
- this.embed {
- this.color = enabled.color
- this.title = enabled.title
- this.description = enabled.description
- this.footer {
- this.icon = u.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(u)
- }
- }
+ this.embeds.add(f.enable(u, gID, cID, channel, args))
}
return@action
}
- val disabled = f.disable(u, gID, cID, channel, args)
this.respond {
- this.embed {
- this.color = disabled.color
- this.title = disabled.title
- this.description = disabled.description
- this.footer {
- this.icon = u.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(u)
- }
- }
+ this.embeds.add(f.disable(u, gID, cID, channel, args))
}
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/InfoExtension.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/InfoExtension.kt
similarity index 57%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/InfoExtension.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/InfoExtension.kt
index b47af0b..6445faf 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/InfoExtension.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/InfoExtension.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,13 +16,13 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions
+package net.moonleay.lilJudd.extensions
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
-import dev.kord.rest.builder.message.embed
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.MessageUtil
import net.moonleay.liljudd.build.BuildConstants
-import net.moonleay.liljudd.util.EmbedColor
class InfoExtension : Extension() {
override val name = "info"
@@ -31,17 +31,16 @@ class InfoExtension : Extension() {
name = "info"
description = "Show infos about the bot"
this.action {
- this.respond {
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "Li'l Judd"
- this.description = "Li'l Judd ***v." + BuildConstants.version + "***\n" +
- "Kord-Extensions ***v." + BuildConstants.kordVersion + "***\n" +
- "Coroutines ***v." + BuildConstants.coroutinesVersion + "***\n" +
- "Krontab ***v." + BuildConstants.krontabVersion + "***\n\n" +
- "Splatoon 3 api data provided by splatoon3.ink"
- }
- }
+ MessageUtil.sendEmbedForPublicSlashCommand(
+ this,
+ EmbedColor.INFO,
+ "Lil' Judd",
+ "Lil' Judd ***v." + BuildConstants.version + "***\n" +
+ "Kord-Extensions ***v." + BuildConstants.kordVersion + "***\n" +
+ "Coroutines ***v." + BuildConstants.coroutinesVersion + "***\n" +
+ "Krontab ***v." + BuildConstants.krontabVersion + "***\n\n" +
+ "Splatoon 3 api data provided by splatoon3.ink"
+ )
}
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/MatchExtension.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/MatchExtension.kt
similarity index 56%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/MatchExtension.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/MatchExtension.kt
index 7d6a8c6..9f2674d 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/MatchExtension.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/MatchExtension.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,25 +16,27 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions
+package net.moonleay.lilJudd.extensions
import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
+import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalString
import com.kotlindiscord.kord.extensions.commands.converters.impl.string
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
+import com.kotlindiscord.kord.extensions.types.respond
+import dev.kord.core.behavior.channel.createMessage
import dev.kord.core.behavior.createRole
-import dev.kord.rest.builder.message.actionRow
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.data.database.entry.MatchPlanningDataData
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.extensions.component.MatchTypes
-import net.moonleay.liljudd.jobs.MatchJob
-import net.moonleay.liljudd.jobs.component.JobManager
-import net.moonleay.liljudd.util.EmbedColor
-import net.moonleay.liljudd.util.EmbedUtil
-import net.moonleay.liljudd.util.MessageUtil
-import net.moonleay.liljudd.util.TimeUtil
+import dev.kord.rest.builder.message.create.actionRow
+import net.moonleay.lilJudd.data.database.entry.MatchPlanningDataData
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.extensions.component.MatchTypes
+import net.moonleay.lilJudd.jobs.MatchJob
+import net.moonleay.lilJudd.jobs.component.JobManager
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.EmbedUtil
+import net.moonleay.lilJudd.util.MessageUtil
+import net.moonleay.lilJudd.util.TimeUtil
class MatchExtension : Extension() {
@@ -52,23 +54,26 @@ class MatchExtension : Extension() {
val m = this.member!!
val gID = this.guild!!.id.value
val cID = this.channel.id.value
- val opponent = args.opponent
- if (!TimeUtil.validateDateString(args.timeStamp)) {
- this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "400: Bad Request"
- this.description = "The given timestamp is invalid.\n" +
- "Please use the format \"dd.MM.yyyy HH:mm\"."
- this.footer {
- this.icon = m.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(m.asUser())
- }
- }
+ val opponent = args.opponent ?: "?"
+ val msg = this.respond {
+ this.embeds.add(
+ MessageUtil.getEmbedWithTable(
+ EmbedColor.INFO,
+ args.matchType.readableName,
+ "***Vs. $opponent***\n" +
+ "At ${args.timeStamp}\n" +
+ "Registered by ${m.mention}",
+ mapOf(
+ "Signed up" to listOf(),
+ "Unavailable" to listOf(),
+ )
+ )
+ )
+
+ this.actionRow {
+ this.components.addAll(EmbedUtil.getMatchButtons().components)
}
- return@action
- }
- // filter time to date:
+ } // filter time to date:
val zdt = TimeUtil.getDateFromString(args.timeStamp)
// get the string for the cronjob
val jobString = TimeUtil.getCronjobStringFromDate(zdt)
@@ -80,47 +85,19 @@ class MatchExtension : Extension() {
}
// Check if the role was created successfully
if (role == null) {
- this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "500: Internal Error"
- this.description = "Could not find created role.\n" +
- "It seems, that said role could not be created."
- this.footer {
- this.icon = m.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(m.asUser())
- }
- }
+ this.channel.createMessage {
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.ERROR,
+ "500: Internal Error",
+ "Could not find created role.\n" +
+ "It seems, that said role could not be created.",
+ "system message"
+ )
+ )
}
return@action
}
- val msg = this.respond {
- val eb = MessageUtil.getEmbedWithTable(
- EmbedColor.INFO,
- args.matchType.readableName,
- "***Vs. $opponent***\n" +
- "At ${args.timeStamp}\n" +
- "Registered by ${m.mention}",
- mapOf(
- "Signed up" to listOf(),
- "Unavailable" to listOf(),
- )
- )
- this.embed {
- this.color = eb.color
- this.title = eb.title
- this.description = eb.description
- this.fields = eb.fields
- this.footer {
- this.icon = m.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(m.asUser())
- }
- }
-
- this.actionRow {
- this.components.addAll(EmbedUtil.getMatchButtons().components)
- }
- }
val tID = MatchPlanningDataRepository.write(
MatchPlanningDataData(
0,
@@ -137,7 +114,6 @@ class MatchExtension : Extension() {
)
if (tID == null || tID <= 0) {
return@action // Not saved to db
- // TODO: Add error message
}
JobManager.addJob(
MatchJob(
@@ -164,7 +140,7 @@ class MatchExtension : Extension() {
this.description = "The timestamp of the match. Format \"dd.MM.yyyy HH:mm\"."
}
- val opponent by string {
+ val opponent by optionalString {
this.name = "opponent"
this.description = "The opponent"
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/SendPlannerExtension.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/SendPlannerExtension.kt
similarity index 54%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/SendPlannerExtension.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/SendPlannerExtension.kt
index a2d98dc..781de2c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/SendPlannerExtension.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/SendPlannerExtension.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,20 +16,19 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions
+package net.moonleay.lilJudd.extensions
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
+import com.kotlindiscord.kord.extensions.types.respond
import com.kotlindiscord.kord.extensions.utils.hasPermission
import dev.kord.common.entity.Permission
import dev.kord.core.behavior.channel.createMessage
-import dev.kord.rest.builder.message.actionRow
-import dev.kord.rest.builder.message.embed
+import dev.kord.rest.builder.message.create.actionRow
import kotlinx.coroutines.delay
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
-import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
-import net.moonleay.liljudd.util.*
+import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
+import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
+import net.moonleay.lilJudd.util.*
import java.time.ZoneId
import java.time.ZonedDateTime
@@ -41,7 +40,7 @@ class SendPlannerExtension : Extension() {
get() = false
override suspend fun setup() {
- publicSlashCommand {
+ publicSlashCommand() {
name = "sendplanner"
description = "Send the planner for the current week"
this.action {
@@ -49,31 +48,13 @@ class SendPlannerExtension : Extension() {
.hasPermission(Permission.Administrator)
) {
val res = this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "401: Not Authorized"
- this.description =
- "You need the Administrator permission to use this command."
- this.footer {
- this.icon = user.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(user)
- }
- }
+ this.content = "You need to be an administrator to use this command."
}
res.delete()
return@action
}
val res = this.respond {
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "200: Success"
- this.description = "Sending the planner.\n" +
- "This may take a while, please be patient."
- this.footer {
- this.icon = user.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(user)
- }
- }
+ this.content = "OK."
}
res.delete() // Delete the response
val c = this.getChannel().asChannel()
@@ -83,40 +64,30 @@ class SendPlannerExtension : Extension() {
.withHour(4)
.withMinute(0).withSecond(0)
c.createMessage {
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "Time Planning Feature"
- this.description = "Do you have time on the following Days?"
- this.footer {
- this.icon = Bot.bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.INFO,
+ "Time Planning Feature",
+ "Do you have time on the following Days?",
+ "Automated Message"
+ )
+ )
}
delay(1000)
repeat(7) {
- val eb = MessageUtil.getEmbedWithTable(
- EmbedColor.INFO,
- "",
- "${then.dayOfWeek.name}, ${then.dayOfMonth}.${then.monthValue}.${then.year} /${it + 1}. weekday",
- mapOf(
- "Is available" to listOf(),
- "May be available" to listOf(),
- "Is not available" to listOf()
- )
- )
-
val msg = c.createMessage {
- this.embed {
- this.color = eb.color
- this.title = eb.title
- this.description = eb.description
- this.fields = eb.fields
- this.footer {
- this.icon = Bot.bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbedWithTable(
+ EmbedColor.INFO,
+ "",
+ "${then.dayOfWeek.name}, ${then.dayOfMonth}.${then.monthValue}.${then.year} /${it + 1}. weekday",
+ mapOf(
+ "Is available" to listOf(),
+ "May be available" to listOf(),
+ "Is not available" to listOf()
+ )
+ )
+ )
this.actionRow {
this.components.addAll(EmbedUtil.getTimePlannerButtons().components)
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/UpdateRolesExtension.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/UpdateRolesExtension.kt
similarity index 54%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/UpdateRolesExtension.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/UpdateRolesExtension.kt
index 7ffe5e9..be6ba80 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/UpdateRolesExtension.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/UpdateRolesExtension.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,17 +16,17 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions
+package net.moonleay.lilJudd.extensions
import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
+import com.kotlindiscord.kord.extensions.types.respond
import com.kotlindiscord.kord.extensions.utils.hasPermission
import dev.kord.common.entity.Permission
-import dev.kord.rest.builder.message.embed
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.util.EmbedColor
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
class UpdateRolesExtension : Extension() {
override val name = "updateroles"
@@ -34,7 +34,7 @@ class UpdateRolesExtension : Extension() {
get() = false
override suspend fun setup() {
- publicSlashCommand {
+ publicSlashCommand() {
name = "updateroles"
description = "Update the roles of the members in the current server"
this.action {
@@ -42,31 +42,30 @@ class UpdateRolesExtension : Extension() {
.hasPermission(Permission.Administrator)
) {
this.respond {
- this.embed {
- this.color = EmbedColor.ERROR.color
- this.title = "401: Not Authorized"
- this.description =
- "You need the Administrator permission to use this command."
- this.footer {
- this.icon = user.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(user)
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.ERROR,
+ "403: Forbidden",
+ "You need to be an administrator to use this command.",
+ user.asUser().username + "#" + user.asUser().discriminator
+ )
+ )
}
return@action
}
this.respond {
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "200: Success"
- this.description = "Updating roles.\n" +
- "This may take a while, please be patient."
- this.footer {
- this.icon = user.asUser().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter(user)
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.SUCCESS,
+ "200: Success",
+ "Updating roles.\n" +
+ "This may take a while, please be patient.",
+ user.asUser().username + "#" + user.asUser().discriminator
+ )
+ )
}
+
+ // -- below here is the code of the cronjob --
Logger.out("Starting to update roles...")
AvailabilityManager.updateInChannel(this.channel.id)
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/component/EnableOrDisable.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/component/EnableOrDisable.kt
similarity index 91%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/component/EnableOrDisable.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/component/EnableOrDisable.kt
index 4cd9a92..6d5e614 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/component/EnableOrDisable.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/component/EnableOrDisable.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions.component
+package net.moonleay.lilJudd.extensions.component
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/component/MatchTypes.kt b/src/main/kotlin/net/moonleay/lilJudd/extensions/component/MatchTypes.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/extensions/component/MatchTypes.kt
rename to src/main/kotlin/net/moonleay/lilJudd/extensions/component/MatchTypes.kt
index cc60220..3cde91b 100644
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/component/MatchTypes.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/extensions/component/MatchTypes.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.extensions.component
+package net.moonleay.lilJudd.extensions.component
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/AvailabilityManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/features/AvailabilityManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt
index e4d0441..cc49d1c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/AvailabilityManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/AvailabilityManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features
+package net.moonleay.lilJudd.features
import com.kotlindiscord.kord.extensions.utils.isNullOrBot
import dev.inmo.krontab.buildSchedule
@@ -29,22 +29,22 @@ import dev.kord.core.entity.channel.Channel
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.gateway.PrivilegedIntent
import dev.kord.rest.builder.message.EmbedBuilder
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.database.entry.PlanningNotifierRolesData
-import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
-import net.moonleay.liljudd.data.database.repository.PlanningNotifierRolesRepository
-import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
-import net.moonleay.liljudd.extensions.FeatureManageExtension
-import net.moonleay.liljudd.features.component.FeatureEnum
-import net.moonleay.liljudd.features.component.IFeature
-import net.moonleay.liljudd.util.*
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.data.database.entry.PlanningNotifierRolesData
+import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
+import net.moonleay.lilJudd.data.database.repository.PlanningNotifierRolesRepository
+import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
+import net.moonleay.lilJudd.extensions.FeatureManageExtension
+import net.moonleay.lilJudd.features.component.FeatureEnum
+import net.moonleay.lilJudd.features.component.IFeature
+import net.moonleay.lilJudd.util.*
import java.time.ZonedDateTime
object AvailabilityManager : IFeature {
// This runs during the cronjob.
suspend fun runThread() {
- Logger.out("Updating match roles")
+ Logger.out("Starting to update roles...")
// ChannelID, Data
val messages = TimePlanningMessagesRepository.getWeek(TimeUtil.getWeekStamp().toEpochSecond())
@@ -70,7 +70,7 @@ object AvailabilityManager : IFeature {
}
this.updateInChannel(snf, data, roleData)
}
- Logger.out("Finished updating roles")
+ Logger.out("Done! Until tomorrow! <3 ")
}
suspend fun updateInChannel(snf: Snowflake) {
@@ -162,7 +162,7 @@ object AvailabilityManager : IFeature {
// Register the cronjob to run at 1AM UTC every day
override suspend fun registerThread() {
- Logger.out("Registering daily planning message role update coroutine")
+ Logger.out("Adding availability scheduler...")
val scheduler = buildSchedule("0 0 2 * * *") // 0 0 4 * * * 0o 1w // 0o is UTC
scheduler.doInfinity {
this.runThread()
@@ -176,7 +176,7 @@ object AvailabilityManager : IFeature {
ch: Channel,
args: FeatureManageExtension.FeatureManagerArgs
): EmbedBuilder {
- val alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
+ var alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
// Check if the channel and guild already exist in the db
if (!alreadyExists) {
// Create the roles in Discord
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/MatchManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/MatchManager.kt
similarity index 80%
rename from src/main/kotlin/net/moonleay/liljudd/features/MatchManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/MatchManager.kt
index 1bdeafe..129fdc0 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/MatchManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/MatchManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,19 +16,19 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features
+package net.moonleay.lilJudd.features
import dev.kord.common.entity.Snowflake
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.database.entry.MatchPlanningDataData
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.jobs.MatchJob
-import net.moonleay.liljudd.jobs.component.JobManager
-import net.moonleay.liljudd.util.Logger
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.data.database.entry.MatchPlanningDataData
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.jobs.MatchJob
+import net.moonleay.lilJudd.jobs.component.JobManager
+import net.moonleay.lilJudd.util.Logger
object MatchManager {
suspend fun update() {
- Logger.out("Updating matches")
+ Logger.out("Updating match roles...")
val dataList = MatchPlanningDataRepository.getAll()
for (data in dataList) {
@@ -41,7 +41,7 @@ object MatchManager {
}
this.registerJob(data)
}
- Logger.out("Finished updating matches")
+ Logger.out("Done. Until next time! <3 ")
}
private fun registerJob(data: MatchPlanningDataData) {
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/TimeManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/TimeManager.kt
similarity index 62%
rename from src/main/kotlin/net/moonleay/liljudd/features/TimeManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/TimeManager.kt
index 0496dff..ec073ac 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/TimeManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/TimeManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features
+package net.moonleay.lilJudd.features
import dev.inmo.krontab.buildSchedule
import dev.inmo.krontab.doInfinity
@@ -26,22 +26,21 @@ import dev.kord.core.behavior.channel.createMessage
import dev.kord.core.entity.channel.Channel
import dev.kord.core.entity.channel.MessageChannel
import dev.kord.rest.builder.message.EmbedBuilder
-import dev.kord.rest.builder.message.actionRow
-import dev.kord.rest.builder.message.embed
+import dev.kord.rest.builder.message.create.actionRow
import kotlinx.coroutines.delay
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.database.entry.TimePlanningChannelsData
-import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
-import net.moonleay.liljudd.data.database.repository.PlanningNotifierRolesRepository
-import net.moonleay.liljudd.data.database.repository.TimePlanningChannelsRepository
-import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
-import net.moonleay.liljudd.extensions.FeatureManageExtension
-import net.moonleay.liljudd.features.component.FeatureEnum
-import net.moonleay.liljudd.features.component.IFeature
-import net.moonleay.liljudd.util.EmbedColor
-import net.moonleay.liljudd.util.EmbedUtil
-import net.moonleay.liljudd.util.Logger
-import net.moonleay.liljudd.util.MessageUtil
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.data.database.entry.TimePlanningChannelsData
+import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
+import net.moonleay.lilJudd.data.database.repository.PlanningNotifierRolesRepository
+import net.moonleay.lilJudd.data.database.repository.TimePlanningChannelsRepository
+import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
+import net.moonleay.lilJudd.extensions.FeatureManageExtension
+import net.moonleay.lilJudd.features.component.FeatureEnum
+import net.moonleay.lilJudd.features.component.IFeature
+import net.moonleay.lilJudd.util.EmbedColor
+import net.moonleay.lilJudd.util.EmbedUtil
+import net.moonleay.lilJudd.util.Logger
+import net.moonleay.lilJudd.util.MessageUtil
import java.time.ZoneId
import java.time.ZonedDateTime
@@ -52,7 +51,7 @@ object TimeManager : IFeature {
// Register the cronjob to run at 0:01 AM UTC every Monday
override suspend fun registerThread() {
- Logger.out("Registering weekly planning message posting coroutine")
+ Logger.out("Adding message scheduler...")
val scheduler = buildSchedule("0 0 1 * * * 0o 1w") // 0 0 4 * * * 0o 1w // 0o is UTC
scheduler.doInfinity {
this.runThread()
@@ -60,7 +59,7 @@ object TimeManager : IFeature {
}
private suspend fun runThread() {
- Logger.out("Starting to send out weekly planning messages")
+ Logger.out("Starting to notify...")
// ChannelID -> Data
val targetedChannels = TimePlanningChannelsRepository.getAll().associateBy { it.channelID }
@@ -72,60 +71,50 @@ object TimeManager : IFeature {
for (ch2 in targetedChannels.keys) {
val ch = Snowflake(ch2)
if (Bot.bot.kordRef.getChannel(ch) == null)
- continue
+ continue // TODO: Check if the channel is valid in another shard
val c = Bot.bot.kordRef.getChannelOf(ch)!!
msgStr = ""
if (targetedRoles != null && targetedRoles.keys.contains(ch2) && targetedRoles[ch2] != null) {
c.createMessage {
this.content =
"The weekly planning starts now <@&${Snowflake(targetedRoles[ch2]?.wantsToBeNotifiedID!!)}>"
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "Time Planning Feature"
- this.description = "Do you have time on the following Days?"
- this.footer {
- this.icon = Bot.bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.INFO,
+ "Time Planning Feature",
+ "Do you have time on the following Days?",
+ "Automated Message"
+ )
+ )
}
} else {
c.createMessage {
- this.embed {
- this.color = EmbedColor.INFO.color
- this.title = "Time Planning Feature"
- this.description = "Do you have time on the following Days?"
- this.footer {
- this.icon = Bot.bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbed(
+ EmbedColor.INFO,
+ "Time Planning Feature",
+ "Do you have time on the following Days?",
+ "Automated Message"
+ )
+ )
}
}
delay(2000)
var then = ZonedDateTime.now(ZoneId.of("Europe/Berlin")).withHour(4).withMinute(0).withSecond(0)
repeat(7) {
- val eb = MessageUtil.getEmbedWithTable(
- EmbedColor.INFO,
- "",
- "${then.dayOfWeek.name}, ${then.dayOfMonth}.${then.monthValue}.${then.year} /${it + 1}. weekday",
- mapOf(
- "Is available" to listOf(),
- "May be available" to listOf(),
- "Is not available" to listOf()
- )
- )
val msg = c.createMessage {
- this.embed {
- this.color = eb.color
- this.title = eb.title
- this.description = eb.description
- this.fields = eb.fields
- this.footer {
- this.icon = Bot.bot.kordRef.getSelf().avatar?.cdnUrl?.toUrl()
- this.text = MessageUtil.getFooter()
- }
- }
+ this.embeds.add(
+ MessageUtil.getEmbedWithTable(
+ EmbedColor.INFO,
+ "",
+ "${then.dayOfWeek.name}, ${then.dayOfMonth}.${then.monthValue}.${then.year} /${it + 1}. weekday",
+ mapOf(
+ "Is available" to listOf(),
+ "May be available" to listOf(),
+ "Is not available" to listOf()
+ )
+ )
+ )
this.actionRow {
this.components.addAll(EmbedUtil.getTimePlannerButtons().components)
@@ -133,7 +122,7 @@ object TimeManager : IFeature {
}
msgStr += "${it}:${msg.id.value};"
then = then.plusDays(1).withHour(4).withMinute(0).withSecond(0)
- Logger.out("Finished sending day $it in $ch")
+ Logger.out("Finished sending day $it")
delay(1000)
}
@@ -166,14 +155,14 @@ object TimeManager : IFeature {
EmbedColor.SUCCESS,
"200: Success",
"The feature was enabled in channel ${args.channel.data.name.value}",
- u.asUser().username
+ u.asUser().username + "#" + u.asUser().discriminator
)
}
return MessageUtil.getEmbed(
EmbedColor.ERROR,
- "409: Conflict",
+ "403: Forbidden",
"The feature is already enabled in this channel.",
- u.asUser().username
+ u.asUser().username + "#" + u.asUser().discriminator
)
}
@@ -186,21 +175,21 @@ object TimeManager : IFeature {
): EmbedBuilder {
// Check if entry exists in db
if (TimePlanningChannelsRepository.exists(cID, gID)) {
- // delete all entries for this channel
+ // delete all entrys for this channel
TimePlanningChannelsRepository.deleteFromChannelInServer(cID, gID)
return MessageUtil.getEmbed(
EmbedColor.SUCCESS,
"200: Success",
"The feature was disabled.",
- u.asUser().username
+ u.asUser().username + "#" + u.asUser().discriminator
)
}
// Do nothing; not in db
return MessageUtil.getEmbed(
EmbedColor.ERROR,
- "409: Conflict",
+ "403: Forbidden",
"The feature is already disabled in this channel.",
- u.asUser().username
+ u.asUser().username + "#" + u.asUser().discriminator
)
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/component/FeatureEnum.kt b/src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureEnum.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/features/component/FeatureEnum.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureEnum.kt
index b06fc3b..8b3a0a8 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/component/FeatureEnum.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureEnum.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features.component
+package net.moonleay.lilJudd.features.component
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/component/FeatureManager.kt b/src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureManager.kt
similarity index 82%
rename from src/main/kotlin/net/moonleay/liljudd/features/component/FeatureManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureManager.kt
index a9212b4..d380d9c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/component/FeatureManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/component/FeatureManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,10 +16,10 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features.component
+package net.moonleay.lilJudd.features.component
-import net.moonleay.liljudd.features.AvailabilityManager
-import net.moonleay.liljudd.features.TimeManager
+import net.moonleay.lilJudd.features.AvailabilityManager
+import net.moonleay.lilJudd.features.TimeManager
object FeatureManager {
val features = mutableListOf(AvailabilityManager, TimeManager) // Stores all features
diff --git a/src/main/kotlin/net/moonleay/liljudd/features/component/IFeature.kt b/src/main/kotlin/net/moonleay/lilJudd/features/component/IFeature.kt
similarity index 89%
rename from src/main/kotlin/net/moonleay/liljudd/features/component/IFeature.kt
rename to src/main/kotlin/net/moonleay/lilJudd/features/component/IFeature.kt
index 77170f3..1145797 100644
--- a/src/main/kotlin/net/moonleay/liljudd/features/component/IFeature.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/features/component/IFeature.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,12 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.features.component
+package net.moonleay.lilJudd.features.component
import dev.kord.core.behavior.UserBehavior
import dev.kord.core.entity.channel.Channel
import dev.kord.rest.builder.message.EmbedBuilder
-import net.moonleay.liljudd.extensions.FeatureManageExtension
+import net.moonleay.lilJudd.extensions.FeatureManageExtension
interface IFeature {
val feat: FeatureEnum
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/MatchJob.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/MatchJob.kt
similarity index 84%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/MatchJob.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/MatchJob.kt
index 130e304..6f13dfa 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/MatchJob.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/MatchJob.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,17 +16,17 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs
+package net.moonleay.lilJudd.jobs
import dev.inmo.krontab.KronScheduler
import dev.kord.common.entity.Snowflake
import kotlinx.coroutines.Job
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
-import net.moonleay.liljudd.jobs.component.CronjobType
-import net.moonleay.liljudd.jobs.component.ICronjob
-import net.moonleay.liljudd.jobs.component.JobManager
-import net.moonleay.liljudd.util.Logger
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
+import net.moonleay.lilJudd.jobs.component.CronjobType
+import net.moonleay.lilJudd.jobs.component.ICronjob
+import net.moonleay.lilJudd.jobs.component.JobManager
+import net.moonleay.lilJudd.util.Logger
class MatchJob(
override val jobIncoming: String,
diff --git a/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiFestivalAndCoopUpdateScheduler.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiFestivalAndCoopUpdateScheduler.kt
new file mode 100644
index 0000000..ff299fc
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiFestivalAndCoopUpdateScheduler.kt
@@ -0,0 +1,50 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.jobs
+
+import dev.inmo.krontab.KronScheduler
+import kotlinx.coroutines.Job
+import net.moonleay.lilJudd.data.api.Splatoon3ApiCache
+import net.moonleay.lilJudd.data.api.type.ApiDataType
+import net.moonleay.lilJudd.data.api.type.ApiRequestType
+import net.moonleay.lilJudd.jobs.component.CronjobType
+import net.moonleay.lilJudd.jobs.component.ICronjob
+import net.moonleay.lilJudd.util.Logger
+
+object Splatoon3ApiFestivalAndCoopUpdateScheduler : ICronjob {
+ override val jobName: String
+ get() = "Splatoon3ApiFestivalAndCoopUpdateScheduler"
+ override val jobIncoming: String
+ get() = "0 0 0 /1 * * 0o *" // once a day
+ override val jobType: CronjobType
+ get() = CronjobType.INFINITE
+ override val continueJob: Boolean
+ get() = true
+ override lateinit var cronjobJob: Job
+ override lateinit var scheduler: KronScheduler
+
+ override suspend fun jobFunction() {
+ Logger.out("Running Splatoon3ApiFestivalUpdateScheduler.")
+ Splatoon3ApiCache.updateData(ApiDataType.SPLATFESTS, ApiRequestType.AUTOMATIC_CACHE_UPDATE)
+ Logger.out("Splatoon3ApiFestivalUpdateScheduler finished.")
+ Logger.out("Running Splatoon3ApiCoopUpdateScheduler.")
+ Splatoon3ApiCache.updateData(ApiDataType.COOP, ApiRequestType.AUTOMATIC_CACHE_UPDATE)
+ Logger.out("Splatoon3ApiCoopUpdateScheduler finished.")
+ }
+}
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt
similarity index 67%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt
index b5701c0..5c38b15 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiScheduleUpdateScheduler.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,14 +16,16 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs
+package net.moonleay.lilJudd.jobs
import dev.inmo.krontab.KronScheduler
import kotlinx.coroutines.Job
-import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3Api
-import net.moonleay.liljudd.jobs.component.CronjobType
-import net.moonleay.liljudd.jobs.component.ICronjob
-import net.moonleay.liljudd.util.Logger
+import net.moonleay.lilJudd.data.api.Splatoon3ApiCache
+import net.moonleay.lilJudd.data.api.type.ApiDataType
+import net.moonleay.lilJudd.data.api.type.ApiRequestType
+import net.moonleay.lilJudd.jobs.component.CronjobType
+import net.moonleay.lilJudd.jobs.component.ICronjob
+import net.moonleay.lilJudd.util.Logger
object Splatoon3ApiScheduleUpdateScheduler : ICronjob {
override val jobName: String
@@ -38,8 +40,8 @@ object Splatoon3ApiScheduleUpdateScheduler : ICronjob {
override lateinit var scheduler: KronScheduler
override suspend fun jobFunction() {
- Logger.out("Updating Schedules...")
- Splatoon3Api.updateSchedule()
- Logger.out("Updating finished.")
+ Logger.out("Running Splatoon3ApiScheduleUpdateScheduler.")
+ Splatoon3ApiCache.updateData(ApiDataType.SCHEDULES, ApiRequestType.AUTOMATIC_CACHE_UPDATE)
+ Logger.out("Splatoon3ApiScheduleUpdateScheduler finished.")
}
}
diff --git a/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiSplatnetGearUpdateScheduler.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiSplatnetGearUpdateScheduler.kt
new file mode 100644
index 0000000..51048f2
--- /dev/null
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/Splatoon3ApiSplatnetGearUpdateScheduler.kt
@@ -0,0 +1,47 @@
+/*
+ * lilJudd
+ * Copyright (C) 2023 moonleay
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package net.moonleay.lilJudd.jobs
+
+import dev.inmo.krontab.KronScheduler
+import kotlinx.coroutines.Job
+import net.moonleay.lilJudd.data.api.Splatoon3ApiCache
+import net.moonleay.lilJudd.data.api.type.ApiDataType
+import net.moonleay.lilJudd.data.api.type.ApiRequestType
+import net.moonleay.lilJudd.jobs.component.CronjobType
+import net.moonleay.lilJudd.jobs.component.ICronjob
+import net.moonleay.lilJudd.util.Logger
+
+object Splatoon3ApiSplatnetGearUpdateScheduler : ICronjob {
+ override val jobName: String
+ get() = "Splatoon3ApiSplatnetGearUpdateScheduler"
+ override val jobIncoming: String
+ get() = "0 0 /6 * * * 0o *" //Every 6 hours
+ override val jobType: CronjobType
+ get() = CronjobType.INFINITE
+ override val continueJob: Boolean
+ get() = true
+ override lateinit var cronjobJob: Job
+ override lateinit var scheduler: KronScheduler
+
+ override suspend fun jobFunction() {
+ Logger.out("Running Splatoon3ApiSplatnetGearUpdateScheduler.")
+ Splatoon3ApiCache.updateData(ApiDataType.SPLATNETGEAR, ApiRequestType.AUTOMATIC_CACHE_UPDATE)
+ Logger.out("Splatoon3ApiSplatnetGearUpdateScheduler finished.")
+ }
+}
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/StatusUpdater.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/StatusUpdater.kt
similarity index 63%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/StatusUpdater.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/StatusUpdater.kt
index fdb421b..7df554b 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/StatusUpdater.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/StatusUpdater.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,21 +16,21 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs
+package net.moonleay.lilJudd.jobs
import dev.inmo.krontab.KronScheduler
import dev.kord.common.entity.PresenceStatus
import kotlinx.coroutines.Job
-import net.moonleay.liljudd.Bot
-import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
-import net.moonleay.liljudd.jobs.component.CronjobType
-import net.moonleay.liljudd.jobs.component.ICronjob
+import net.moonleay.lilJudd.Bot
+import net.moonleay.lilJudd.data.api.Splatoon3Api
+import net.moonleay.lilJudd.jobs.component.CronjobType
+import net.moonleay.lilJudd.jobs.component.ICronjob
object StatusUpdater : ICronjob {
override val jobName: String
get() = "StatusUpdater"
override val jobIncoming: String
- get() = "/30 * * * * * 0o *" //Every 30 seconds
+ get() = "/5 * * * * * 0o *" //Every 5 seconds
override val jobType: CronjobType
get() = CronjobType.INFINITE
override val continueJob: Boolean
@@ -41,26 +41,27 @@ object StatusUpdater : ICronjob {
private var statusList = listOf()
private var index = 0
- // I h8 this cronjob. I'll recode this someday.
override suspend fun jobFunction() {
- if (index >= statusList.size) {
- index = 0
- refreshStatusList(System.currentTimeMillis())
- }
+ refreshStatusList(System.currentTimeMillis())
Bot.bot.kordRef.editPresence {
this.status = PresenceStatus.DoNotDisturb
- this.competing(statusList[index])
+ this.playing(statusList[index])
}
++index
+ if (index >= statusList.size) {
+ index = 0
+ }
}
- private fun refreshStatusList(timestamp: Long) {
+ fun refreshStatusList(timestamp: Long) {
statusList = listOf(
- Splatoon3ApiDataGrabber.getRotationTime(timestamp),
- Splatoon3ApiDataGrabber.getRegularMapsFormatted(timestamp),
- Splatoon3ApiDataGrabber.getOpenMapFormatted(timestamp),
- Splatoon3ApiDataGrabber.getSeriesMapsFormatted(timestamp),
- Splatoon3ApiDataGrabber.getXMapFormatted(timestamp)
+ Splatoon3Api.getRegularMapsFormatted(timestamp),
+ Splatoon3Api.getSeriesModeFormatted(timestamp),
+ Splatoon3Api.getSeriesMapsFormatted(timestamp),
+ Splatoon3Api.getOpenModeFormatted(timestamp),
+ Splatoon3Api.getOpenMapFormatted(timestamp),
+ Splatoon3Api.getXModeFormatted(timestamp),
+ Splatoon3Api.getXMapFormatted(timestamp),
)
}
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/component/CronjobType.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/CronjobType.kt
similarity index 90%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/component/CronjobType.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/component/CronjobType.kt
index fa1992b..fa34b60 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/component/CronjobType.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/CronjobType.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs.component
+package net.moonleay.lilJudd.jobs.component
enum class CronjobType {
INFINITE,
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/component/ICronjob.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/ICronjob.kt
similarity index 94%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/component/ICronjob.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/component/ICronjob.kt
index 8e3f946..d3f6700 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/component/ICronjob.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/ICronjob.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs.component
+package net.moonleay.lilJudd.jobs.component
import dev.inmo.krontab.KronScheduler
import kotlinx.coroutines.Job
diff --git a/src/main/kotlin/net/moonleay/liljudd/jobs/component/JobManager.kt b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/JobManager.kt
similarity index 96%
rename from src/main/kotlin/net/moonleay/liljudd/jobs/component/JobManager.kt
rename to src/main/kotlin/net/moonleay/lilJudd/jobs/component/JobManager.kt
index ce62d1c..cc55256 100644
--- a/src/main/kotlin/net/moonleay/liljudd/jobs/component/JobManager.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/jobs/component/JobManager.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.jobs.component
+package net.moonleay.lilJudd.jobs.component
import dev.inmo.krontab.buildSchedule
import dev.inmo.krontab.doInfinityTz
@@ -25,7 +25,7 @@ import dev.inmo.krontab.doWhileTz
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
-import net.moonleay.liljudd.util.Logger
+import net.moonleay.lilJudd.util.Logger
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/EmbedColor.kt b/src/main/kotlin/net/moonleay/lilJudd/util/EmbedColor.kt
similarity index 92%
rename from src/main/kotlin/net/moonleay/liljudd/util/EmbedColor.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/EmbedColor.kt
index 7d9def4..cb3e983 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/EmbedColor.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/EmbedColor.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
import dev.kord.common.Color
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/EmbedUtil.kt b/src/main/kotlin/net/moonleay/lilJudd/util/EmbedUtil.kt
similarity index 98%
rename from src/main/kotlin/net/moonleay/liljudd/util/EmbedUtil.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/EmbedUtil.kt
index f109ed3..17615b3 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/EmbedUtil.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/EmbedUtil.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
import dev.kord.common.entity.ButtonStyle
import dev.kord.core.entity.Embed
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/Logger.kt b/src/main/kotlin/net/moonleay/lilJudd/util/Logger.kt
similarity index 95%
rename from src/main/kotlin/net/moonleay/liljudd/util/Logger.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/Logger.kt
index 25a5804..446609c 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/Logger.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/Logger.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/MessageUtil.kt b/src/main/kotlin/net/moonleay/lilJudd/util/MessageUtil.kt
similarity index 57%
rename from src/main/kotlin/net/moonleay/liljudd/util/MessageUtil.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/MessageUtil.kt
index f531dd0..6dfb545 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/MessageUtil.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/MessageUtil.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,9 +16,12 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
-import dev.kord.core.behavior.UserBehavior
+import com.kotlindiscord.kord.extensions.commands.Arguments
+import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext
+import com.kotlindiscord.kord.extensions.components.forms.ModalForm
+import com.kotlindiscord.kord.extensions.types.respond
import dev.kord.core.entity.Embed
import dev.kord.rest.builder.message.EmbedBuilder
import java.time.LocalDateTime
@@ -27,9 +30,44 @@ import java.time.format.DateTimeFormatter
object MessageUtil {
private val dtf: DateTimeFormatter = DateTimeFormatter.ofPattern("dd/MM/yyyy @ HH:mm:ss")
- suspend fun getFooter(u: UserBehavior? = null): String {
- val now: LocalDateTime = LocalDateTime.now()
- return ">" + dtf.format(now) + " - ${u?.asUser()?.username ?: "Automated Message"}"
+ ///Send an embedded message as a reply
+ suspend fun sendEmbedForPublicSlashCommand(
+ ctx: PublicSlashCommandContext,
+ color: EmbedColor,
+ title: String,
+ description: String
+ ) {
+ ctx.respond {
+ embeds.add(
+ getEmbed(
+ color,
+ title,
+ description,
+ ctx.user.asUser().username + "#" + ctx.user.asUser().discriminator
+ )
+ )
+ }
+ }
+
+ ///Send an embedded message with an image as a reply
+ suspend fun sendEmbedForPublicSlashCommandWithImage(
+ ctx: PublicSlashCommandContext,
+ color: EmbedColor,
+ title: String,
+ description: String,
+ thumbnailUrl: String
+ ) {
+ ctx.respond {
+ embeds.add(
+ getEmbedWithImage(
+ color,
+ title,
+ description,
+ ctx.user.asUser().username + "#" + ctx.user.asUser().discriminator,
+ thumbnailUrl
+ )
+ )
+ }
}
///Get a cloned embedded message
@@ -37,11 +75,6 @@ object MessageUtil {
val ebb = EmbedBuilder()
ebb.color = e.color
ebb.title = e.title
- ebb.author {
- this.icon = e.author?.url
- this.name = e.author?.name.toString()
- this.url = e.author?.url
- }
e.fields.forEach {
val fb = EmbedBuilder.Field()
fb.name = it.name
@@ -49,10 +82,6 @@ object MessageUtil {
fb.inline = it.inline
ebb.fields.add(fb)
}
- ebb.footer {
- this.icon = e.footer?.iconUrl
- this.text = e.footer?.text.toString()
- }
ebb.description = e.description
return ebb
}
@@ -61,11 +90,6 @@ object MessageUtil {
val ebb = EmbedBuilder()
ebb.color = e.color
ebb.title = e.title
- ebb.author {
- this.icon = e.author?.url
- this.name = e.author?.name.toString()
- this.url = e.author?.url
- }
e.fields.forEach {
val fb = EmbedBuilder.Field()
fb.name = it.name
@@ -73,14 +97,24 @@ object MessageUtil {
fb.inline = it.inline
ebb.fields.add(fb)
}
- ebb.footer {
- this.icon = e.footer?.icon
- this.text = e.footer?.text.toString()
- }
ebb.description = e.description
return ebb
}
+ fun getEmbedWithTableWithFooter(
+ color: EmbedColor,
+ title: String,
+ description: String,
+ values: Map>?,
+ footer: String
+ ): EmbedBuilder {
+ val ebb = getEmbedWithTable(color, title, description, values)
+ ebb.footer = EmbedBuilder.Footer()
+ ebb.footer!!.text = ">m.id/$footer"
+ return ebb
+ }
+
+ ///Get an embedded msg with image, title and description
fun getEmbedWithTable(
color: EmbedColor,
title: String,
@@ -102,6 +136,7 @@ object MessageUtil {
return ebb
}
+
///Get an embedded msg with title and description
fun getEmbedSmall(
color: EmbedColor,
@@ -129,4 +164,17 @@ object MessageUtil {
return ebb
}
+ ///Get an embedded msg with image, title, description and a src
+ fun getEmbedWithImage(
+ color: EmbedColor,
+ title: String,
+ description: String,
+ source: String,
+ thumbnailUrl: String
+ ): EmbedBuilder {
+ val ebb = getEmbed(color, title, description, source)
+ ebb.thumbnail = EmbedBuilder.Thumbnail()
+ ebb.thumbnail!!.url = thumbnailUrl
+ return ebb
+ }
}
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/NetUtil.kt b/src/main/kotlin/net/moonleay/lilJudd/util/NetUtil.kt
similarity index 96%
rename from src/main/kotlin/net/moonleay/liljudd/util/NetUtil.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/NetUtil.kt
index 665d0bb..5b43bbc 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/NetUtil.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/NetUtil.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
import java.net.URL
import javax.net.ssl.HttpsURLConnection
diff --git a/src/main/kotlin/net/moonleay/liljudd/util/TimeUtil.kt b/src/main/kotlin/net/moonleay/lilJudd/util/TimeUtil.kt
similarity index 82%
rename from src/main/kotlin/net/moonleay/liljudd/util/TimeUtil.kt
rename to src/main/kotlin/net/moonleay/lilJudd/util/TimeUtil.kt
index bddc8b1..5287bc3 100644
--- a/src/main/kotlin/net/moonleay/liljudd/util/TimeUtil.kt
+++ b/src/main/kotlin/net/moonleay/lilJudd/util/TimeUtil.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-package net.moonleay.liljudd.util
+package net.moonleay.lilJudd.util
import kotlinx.datetime.DayOfWeek
import java.time.Duration
@@ -145,16 +145,6 @@ object TimeUtil {
.withMinute(0).withSecond(0)
}
- fun validateDateString(input: String): Boolean {
- val formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")
- return try {
- LocalDateTime.parse(input, formatter)
- true
- } catch (e: Exception) {
- false
- }
- }
-
fun getDateFromString(input: String): ZonedDateTime {
val formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm")
val localDateTime = LocalDateTime.parse(input, formatter)
@@ -177,24 +167,6 @@ object TimeUtil {
return ZonedDateTime.of(localDateTime, zoneId).toEpochSecond() * 1000
}
- fun getTimeFromJSONTime(inp: String, zone: String): String {
- // 2023-10-05T08:00:00Z
- val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'")
- val localDateTime = LocalDateTime.parse(inp, formatter)
- val zoneId = ZoneId.of(zone) // TODO: Add the possibility to set your timezone
- val returnFormat = DateTimeFormatter.ofPattern("HH:mm")
- return ZonedDateTime.of(localDateTime, zoneId).format(returnFormat)
- }
-
- fun getTimeFromJSONTimeLong(inp: String, zone: String): String {
- // 2023-10-05T08:00:00Z
- val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'")
- val localDateTime = LocalDateTime.parse(inp, formatter)
- val zoneId = ZoneId.of(zone) // TODO: Add the possibility to set your timezone
- val returnFormat = DateTimeFormatter.ofPattern("dd'/'MM',' HH:mm")
- return ZonedDateTime.of(localDateTime, zoneId).format(returnFormat)
- }
-
fun getTimeDifferenceFormatted(start: Long, end: Long): String {
val diff = end - start
return getTimeFormatedShortend(diff, false)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/NewsManager.kt b/src/main/kotlin/net/moonleay/liljudd/data/NewsManager.kt
deleted file mode 100644
index 30dc1e4..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/NewsManager.kt
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data
-
-import java.io.*
-import java.util.*
-
-object NewsManager {
- private const val foldername = "data"
- private const val filename = "news.nick"
- lateinit var shouldPost: String
- lateinit var title: String
- lateinit var news: String
-
- ///Load the needed credentials, generate a config if there is none
- fun load() {
- val folder = File(foldername)
- if (!folder.exists()) {
- save()
- return
- }
- val configFile = File(folder, filename)
- if (!configFile.exists()) {
- save()
- return
- }
- try {
- val input: InputStream = FileInputStream(foldername + File.separator + filename)
- val prop = Properties()
- prop.load(input)
- shouldPost = prop.getProperty("shouldPost")
- title = prop.getProperty("title")
- news = prop.getProperty("news")
- input.close()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
-
- fun update(){
- val folder = File(foldername)
- if (!folder.exists()) {
- try {
- folder.mkdirs()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- val configFile = File(foldername + File.separator + filename)
- if (!configFile.exists()) {
- try {
- configFile.createNewFile()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- try {
- val output: OutputStream = FileOutputStream(foldername + File.separator + filename)
- val prop = Properties()
- prop.setProperty("shouldPost", shouldPost)
- prop.setProperty("title", title)
- prop.setProperty("news", news)
- prop.store(output, null)
- output.close()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
-
- ///generate a new sample config
- private fun save() {
- val folder = File(foldername)
- if (!folder.exists()) {
- try {
- folder.mkdirs()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- val configFile = File(foldername + File.separator + filename)
- if (!configFile.exists()) {
- try {
- configFile.createNewFile()
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
- try {
- val output: OutputStream = FileOutputStream(foldername + File.separator + filename)
- val prop = Properties()
- prop.setProperty("shouldPost", "no")
- prop.setProperty("title", "empty")
- prop.setProperty("news", "empty")
- prop.store(output, null)
- output.close()
-
- shouldPost = "no"
- title = "empty"
- news = "empty"
- } catch (e: IOException) {
- e.printStackTrace()
- }
- }
-}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/StacktraceSaver.kt b/src/main/kotlin/net/moonleay/liljudd/data/StacktraceSaver.kt
deleted file mode 100644
index 84828c2..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/StacktraceSaver.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data
-
-import java.io.File
-
-object StacktraceSaver {
- fun saveStacktrace(stacktrace: Throwable, timestamp: Long) {
- createFolder()
- val dir = File("data", "stacktraces")
- File(dir, "$timestamp.stk").bufferedWriter().use { out ->
- out.write(stacktrace.stackTraceToString())
- }
- }
-
- private fun createFolder() {
- val dir = File("data", "stacktraces")
- if (!dir.exists())
- dir.mkdir()
- }
-}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3Api.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3Api.kt
deleted file mode 100644
index 2b7fa40..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3Api.kt
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink
-
-import kotlinx.serialization.json.Json
-import net.moonleay.liljudd.build.BuildConstants
-import net.moonleay.liljudd.data.api.splatoon3ink.schedules.Schedules
-import net.moonleay.liljudd.util.NetUtil
-
-object Splatoon3Api {
-
- var schedules: Schedules? = null
-
- fun updateSchedule() {
- val response = NetUtil.GETJsonData("https://splatoon3.ink/data/schedules.json", "lilJudd/${BuildConstants.version}")
- if (response.startsWith("error")){
- println("Error: $response")
- return
- }
- schedules = Json.decodeFromString(response)
- }
-}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3ApiDataGrabber.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3ApiDataGrabber.kt
deleted file mode 100644
index 5357116..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/Splatoon3ApiDataGrabber.kt
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink
-
-import net.moonleay.liljudd.data.api.splatoon3ink.schedules.BankaraNode
-import net.moonleay.liljudd.data.api.splatoon3ink.schedules.RegularNode
-import net.moonleay.liljudd.data.api.splatoon3ink.schedules.SalmonRunNode
-import net.moonleay.liljudd.data.api.splatoon3ink.schedules.XNode
-import net.moonleay.liljudd.util.TimeUtil
-
-object Splatoon3ApiDataGrabber {
- fun getRegularMode(timestamp: Long): RegularNode {
- Splatoon3Api.schedules!!.data.regularSchedules.nodes.map { modeData ->
- val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- if (timestamp in startTime..endTime) {
- return modeData
- }
- }
- throw Exception("No current mode found")
- }
-
- fun getOpenMode(timestamp: Long): BankaraNode {
- Splatoon3Api.schedules!!.data.bankaraSchedules.nodes.map { modeData ->
- val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- if (timestamp in startTime..endTime) {
- modeData.bankaraMatchSettings!!.map { matchSetting ->
- if (matchSetting.bankaraMode == "OPEN")
- return modeData
- }
- }
- }
- throw Exception("No current mode found")
- }
-
- fun getXMode(timestamp: Long): XNode {
- Splatoon3Api.schedules!!.data.xSchedules.nodes.map { modeData ->
- val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- if (timestamp in startTime..endTime) {
- return modeData
- }
- }
- throw Exception("No current mode found")
- }
-
- fun getSeriesMode(timestamp: Long): BankaraNode {
- Splatoon3Api.schedules!!.data.bankaraSchedules.nodes.map { modeData ->
- val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- if (timestamp in startTime..endTime) {
- modeData.bankaraMatchSettings!!.map { matchSetting ->
- if (matchSetting.bankaraMode == "CHALLENGE")
- return modeData
- }
- }
- }
- throw Exception("No current mode found")
- }
-
- fun getSalmonRun(timestamp: Long): SalmonRunNode {
- Splatoon3Api.schedules!!.data.coopGroupingSchedule.regularSchedules.nodes.map { modeData ->
- val startTime = TimeUtil.deformatJSONTime(modeData.startTime, "UTC")
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- if (timestamp in startTime..endTime) {
- return modeData
- }
- }
- throw Exception("No current mode found")
- }
- fun getRotationTime(timestamp: Long): String {
- val modeData = getRegularMode(timestamp)
- val endTime = TimeUtil.deformatJSONTime(modeData.endTime, "UTC")
- val diffStamp = TimeUtil.getTimeDifferenceFormatted(System.currentTimeMillis(), endTime)
- return "$diffStamp left in rotation"
- }
-
- fun getRegularMapsFormatted(timestamp: Long): String {
- val modeData = getRegularMode(timestamp)
- val map1 = modeData.regularMatchSetting.vsStages[0].name.split(" ")[0]
- val map2 = modeData.regularMatchSetting.vsStages[1].name.split(" ")[0]
- return "R: $map1, $map2"
- }
-
- fun getOpenMapFormatted(timestamp: Long): String {
- val modeData = getOpenMode(timestamp)
- // FIXME: This may cause issues if there is a Splatfest going on
- // TODO: Check if this works during splatfest
- // The Open Mode should always be the second mode in the list
- // FIXME: Add check if 2nd itm in list is open mode
- val map1 = modeData.bankaraMatchSettings!![1].vsStages[0].name.split(" ")[0]
- val map2 = modeData.bankaraMatchSettings[1].vsStages[1].name.split(" ")[0]
- return "O: ${modeData.bankaraMatchSettings[1].vsRule.name}: $map1, $map2"
- .replace("Rainmaker", "RMK")
- .replace("Tower Control", "TC")
- .replace("Splat Zones", "SZ")
- .replace("Clam Blitz", "CB")
- }
-
- fun getSeriesMapsFormatted(timestamp: Long): String {
- val modeData = getSeriesMode(timestamp)
- // FIXME: This may cause issues if there is a Splatfest going on
- // TODO: Check all the same things as in getOpenMapFormatted
- val map1 = modeData.bankaraMatchSettings!![0].vsStages[0].name.split(" ")[0]
- val map2 = modeData.bankaraMatchSettings[0].vsStages[1].name.split(" ")[0]
- return "S: ${modeData.bankaraMatchSettings[0].vsRule.name}: $map1, $map2"
- .replace("Rainmaker", "RMK")
- .replace("Tower Control", "TC")
- .replace("Splat Zones", "SZ")
- .replace("Clam Blitz", "CB")
- }
-
- fun getXMapFormatted(timestamp: Long): String {
- val modeData = getXMode(timestamp)
- val map1 = modeData.xMatchSetting.vsStages[0].name.split(" ")[0]
- val map2 = modeData.xMatchSetting.vsStages[1].name.split(" ")[0]
- return "X: ${modeData.xMatchSetting.vsRule.name}: $map1, $map2"
- .replace("Rainmaker", "RMK")
- .replace("Tower Control", "TC")
- .replace("Splat Zones", "SZ")
- .replace("Clam Blitz", "CB")
- }
-}
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraMatchSetting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraMatchSetting.kt
deleted file mode 100644
index d4188cd..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraMatchSetting.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class BankaraMatchSetting(
- @SerialName("bankaraMode")
- val bankaraMode: String,
- @SerialName("__isVsSetting")
- val isVsSetting: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("vsRule")
- val vsRule: VsRule,
- @SerialName("vsStages")
- val vsStages: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraNode.kt
deleted file mode 100644
index 20f0c9a..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BankaraNode.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class BankaraNode(
- @SerialName("bankaraMatchSettings")
- val bankaraMatchSettings: List?,
- @SerialName("endTime")
- val endTime: String,
- @SerialName("festMatchSettings")
- val festMatchSettings: List?,
- @SerialName("startTime")
- val startTime: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BigRunSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BigRunSchedules.kt
deleted file mode 100644
index 476dc59..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/BigRunSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class BigRunSchedules(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Color.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Color.kt
deleted file mode 100644
index b359a33..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Color.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Color(
- @SerialName("a")
- val a: Int,
- @SerialName("b")
- val b: Double,
- @SerialName("g")
- val g: Double,
- @SerialName("r")
- val r: Double
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt
deleted file mode 100644
index 1a5d5be..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopGroupingSchedule.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class CoopGroupingSchedule(
- @SerialName("bannerImage")
- val bannerImage: BannerImage?, // is null
- @SerialName("bigRunSchedules")
- val bigRunSchedules: BigRunSchedules,
- @SerialName("regularSchedules")
- val regularSchedules: RegularSchedules,
- @SerialName("teamContestSchedules")
- val teamContestSchedules: TeamContestSchedules?
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopSetting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopSetting.kt
deleted file mode 100644
index 7f20c4c..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopSetting.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class CoopSetting(
- @SerialName("boss")
- val boss: String?, // Not really String, but idk
- @SerialName("coopStage")
- val coopStage: CoopStage,
- @SerialName("__isCoopSetting")
- val isCoopSetting: String,
- @SerialName("rule")
- val rule: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("weapons")
- val weapons: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopStage.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopStage.kt
deleted file mode 100644
index 6441baa..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CoopStage.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class CoopStage(
- @SerialName("id")
- val id: String,
- @SerialName("image")
- val image: Image,
- @SerialName("name")
- val name: String,
- @SerialName("thumbnailImage")
- val thumbnailImage: ThumbnailImage
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentFest.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentFest.kt
deleted file mode 100644
index e2fe9ed..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentFest.kt
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class CurrentFest(
- @SerialName("endTime")
- val endTime: String,
- @SerialName("id")
- val id: String,
- @SerialName("midtermTime")
- val midtermTime: String,
- @SerialName("startTime")
- val startTime: String,
- @SerialName("state")
- val state: String,
- @SerialName("teams")
- val teams: List,
- @SerialName("title")
- val title: String,
- @SerialName("tricolorStage")
- val tricolorStage: TricolorStage
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentPlayer.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentPlayer.kt
deleted file mode 100644
index 50c8f74..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/CurrentPlayer.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class CurrentPlayer(
- @SerialName("userIcon")
- val userIcon: UserIcon
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventNode.kt
deleted file mode 100644
index 2e66a3c..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventNode.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class EventNode(
- @SerialName("leagueMatchSetting")
- val leagueMatchSetting: LeagueMatchSetting,
- @SerialName("timePeriods")
- val timePeriods: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventSchedules.kt
deleted file mode 100644
index fb6ed6f..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/EventSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class EventSchedules(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingX.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingX.kt
deleted file mode 100644
index db4e294..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingX.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class FestMatchSettingX(
- @SerialName("__isVsSetting")
- val isVsSetting: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("vsRule")
- val vsRule: VsRule,
- @SerialName("vsStages")
- val vsStages: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingXX.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingXX.kt
deleted file mode 100644
index d2fbfc5..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestMatchSettingXX.kt
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class FestMatchSettingXX(
- @SerialName("__typename")
- val typename: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestSchedules.kt
deleted file mode 100644
index 9a1acc7..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/FestSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class FestSchedules(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchSetting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchSetting.kt
deleted file mode 100644
index 41cf553..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/LeagueMatchSetting.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class LeagueMatchSetting(
- @SerialName("__isVsSetting")
- val isVsSetting: String,
- @SerialName("leagueMatchEvent")
- val leagueMatchEvent: LeagueMatchEvent,
- @SerialName("__typename")
- val typename: String,
- @SerialName("vsRule")
- val vsRule: VsRule,
- @SerialName("vsStages")
- val vsStages: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/MapNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/MapNode.kt
deleted file mode 100644
index f17d17c..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/MapNode.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class MapNode(
- @SerialName("id")
- val id: String,
- @SerialName("name")
- val name: String,
- @SerialName("originalImage")
- val originalImage: OriginalImage,
- @SerialName("stats")
- val stats: String?, // is null
- @SerialName("vsStageId")
- val vsStageId: Int
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularMatchSetting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularMatchSetting.kt
deleted file mode 100644
index ea899be..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularMatchSetting.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class RegularMatchSetting(
- @SerialName("__isVsSetting")
- val isVsSetting: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("vsRule")
- val vsRule: VsRule,
- @SerialName("vsStages")
- val vsStages: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularNode.kt
deleted file mode 100644
index 9a6935f..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularNode.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class RegularNode(
- @SerialName("endTime")
- val endTime: String,
- @SerialName("festMatchSettings")
- val festMatchSettings: FestMatchSettingXX?,
- @SerialName("regularMatchSetting")
- val regularMatchSetting: RegularMatchSetting,
- @SerialName("startTime")
- val startTime: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedules.kt
deleted file mode 100644
index b6c55db..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class RegularSchedules(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedulesX.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedulesX.kt
deleted file mode 100644
index 04418e0..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/RegularSchedulesX.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class RegularSchedulesX(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SalmonRunNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SalmonRunNode.kt
deleted file mode 100644
index ad53d45..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SalmonRunNode.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class SalmonRunNode(
- @SerialName("endTime")
- val endTime: String,
- @SerialName("setting")
- val setting: Setting,
- @SerialName("__splatoon3ink_king_salmonid_guess")
- val splatoon3inkKingSalmonidGuess: String,
- @SerialName("startTime")
- val startTime: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Schedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Schedules.kt
deleted file mode 100644
index f3d08c7..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Schedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Schedules(
- @SerialName("data")
- val data: SchedulesData
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SchedulesData.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SchedulesData.kt
deleted file mode 100644
index 0bf967a..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/SchedulesData.kt
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class SchedulesData(
- @SerialName("bankaraSchedules")
- val bankaraSchedules: BankaraSchedules,
- @SerialName("coopGroupingSchedule")
- val coopGroupingSchedule: CoopGroupingSchedule,
- @SerialName("currentFest")
- val currentFest: CurrentFest?,
- @SerialName("currentPlayer")
- val currentPlayer: CurrentPlayer,
- @SerialName("eventSchedules")
- val eventSchedules: EventSchedules,
- @SerialName("festSchedules")
- val festSchedules: FestSchedules,
- @SerialName("regularSchedules")
- val regularSchedules: RegularSchedulesX,
- @SerialName("vsStages")
- val vsStages: VsStages,
- @SerialName("xSchedules")
- val xSchedules: XSchedules
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Setting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Setting.kt
deleted file mode 100644
index 3ebd2f2..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Setting.kt
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Setting(
- @SerialName("boss")
- val boss: Boss,
- @SerialName("coopStage")
- val coopStage: CoopStage,
- @SerialName("__isCoopSetting")
- val isCoopSetting: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("weapons")
- val weapons: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestNode.kt
deleted file mode 100644
index 22b36d8..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestNode.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class TeamContestNode(
- @SerialName("endTime")
- val endTime: String,
- @SerialName("setting")
- val setting: CoopSetting,
- @SerialName("startTime")
- val startTime: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt
deleted file mode 100644
index 1265efc..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TeamContestSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class TeamContestSchedules(
- @SerialName("nodes")
- val nodes: List // This is a placeholder.
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/ThumbnailImage.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/ThumbnailImage.kt
deleted file mode 100644
index 9fb03cd..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/ThumbnailImage.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class ThumbnailImage(
- @SerialName("url")
- val url: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TricolorStage.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TricolorStage.kt
deleted file mode 100644
index b5685cc..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/TricolorStage.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class TricolorStage(
- @SerialName("id")
- val id: String,
- @SerialName("image")
- val image: Image,
- @SerialName("name")
- val name: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStage.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStage.kt
deleted file mode 100644
index 0b9cebf..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStage.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class VsStage(
- @SerialName("id")
- val id: String,
- @SerialName("image")
- val image: Image,
- @SerialName("name")
- val name: String,
- @SerialName("vsStageId")
- val vsStageId: Int
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStages.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStages.kt
deleted file mode 100644
index 142508d..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/VsStages.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class VsStages(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Weapon.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Weapon.kt
deleted file mode 100644
index a65820d..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/Weapon.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Weapon(
- @SerialName("image")
- val image: Image,
- @SerialName("name")
- val name: String,
- @SerialName("__splatoon3ink_id")
- val splatoon3inkId: String
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XMatchSetting.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XMatchSetting.kt
deleted file mode 100644
index edca851..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XMatchSetting.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class XMatchSetting(
- @SerialName("__isVsSetting")
- val isVsSetting: String,
- @SerialName("__typename")
- val typename: String,
- @SerialName("vsRule")
- val vsRule: VsRule,
- @SerialName("vsStages")
- val vsStages: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XNode.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XNode.kt
deleted file mode 100644
index 0242771..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XNode.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class XNode(
- @SerialName("endTime")
- val endTime: String,
- @SerialName("festMatchSettings")
- val festMatchSettings: FestMatchSettingXX?,
- @SerialName("startTime")
- val startTime: String,
- @SerialName("xMatchSetting")
- val xMatchSetting: XMatchSetting
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XSchedules.kt b/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XSchedules.kt
deleted file mode 100644
index 9de2887..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/data/api/splatoon3ink/schedules/XSchedules.kt
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.data.api.splatoon3ink.schedules
-
-
-import kotlinx.serialization.SerialName
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class XSchedules(
- @SerialName("nodes")
- val nodes: List
-)
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/RotationExtension.kt b/src/main/kotlin/net/moonleay/liljudd/extensions/RotationExtension.kt
deleted file mode 100644
index d5b0d7e..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/RotationExtension.kt
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.extensions
-
-import com.kotlindiscord.kord.extensions.commands.Arguments
-import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
-import com.kotlindiscord.kord.extensions.extensions.Extension
-import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
-import dev.kord.common.Color
-import dev.kord.rest.builder.message.embed
-import kotlinx.datetime.Clock
-import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
-import net.moonleay.liljudd.extensions.component.SplatoonOnlineMode
-import net.moonleay.liljudd.util.TimeUtil
-
-class RotationExtension : Extension() {
-
- override val name = "rotation"
- override val allowApplicationCommandInDMs: Boolean
- get() = false
-
-
- override suspend fun setup() {
- publicSlashCommand(::RotationArguments) {
- name = "rotation"
- description = "Check the current rotations"
- this.action {
- val mode = this.arguments.mode
- when (mode) {
- SplatoonOnlineMode.ALL -> {
- val regSched = Splatoon3ApiDataGrabber.getRegularMode(System.currentTimeMillis())
- val regMaps = regSched.regularMatchSetting.vsStages
- val regMap1 = regMaps[0]
- val regMap2 = regMaps[1]
-
- val serSched = Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis())
- val serMaps = serSched.bankaraMatchSettings!!.first().vsStages
- val serMap1 = serMaps[0]
- val serMap2 = serMaps[1]
-
- val opnSched = Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis())
- val opnMaps = opnSched.bankaraMatchSettings!!.last().vsStages
- val opnMap1 = opnMaps[0]
- val opnMap2 = opnMaps[1]
-
- val xSched = Splatoon3ApiDataGrabber.getXMode(System.currentTimeMillis())
- val xMaps = xSched.xMatchSetting.vsStages
- val xMap1 = xMaps[0]
- val xMap2 = xMaps[1]
-
- val salSched = Splatoon3ApiDataGrabber.getSalmonRun(System.currentTimeMillis())
- val salMap = salSched.setting.coopStage.name
- val salBoss = salSched.setting.boss.name
- val salWeapons = salSched.setting.weapons
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "All Modes"
- this.description = "[[Open on website](https://splatoon3.ink/)]"
- this.color = Color(0x1437FF)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/deepcut.png"
- }
-
- this.field {
- this.name = "Regular (${
- TimeUtil.getTimeFromJSONTime(
- regSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(regSched.endTime, "UTC")})"
- this.value =
- "${regSched.regularMatchSetting.vsRule.name} on ${regMap1.name} & ${regMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "Series (${
- TimeUtil.getTimeFromJSONTime(
- serSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(serSched.endTime, "UTC")})"
- this.value =
- "${serSched.bankaraMatchSettings.first().vsRule.name} on ${serMap1.name} & ${serMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "Open (${
- TimeUtil.getTimeFromJSONTime(
- opnSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(opnSched.endTime, "UTC")})"
- this.value =
- "${opnSched.bankaraMatchSettings.last().vsRule.name} on ${opnMap1.name} & ${opnMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "X (${
- TimeUtil.getTimeFromJSONTime(
- xSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(xSched.endTime, "UTC")})"
- this.value = "${xSched.xMatchSetting.vsRule.name} on ${xMap1.name} & ${xMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "Salmon Run (${
- TimeUtil.getTimeFromJSONTimeLong(
- salSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTimeLong(salSched.endTime, "UTC")})"
- this.value =
- "${salBoss} on ${salMap} with ${salWeapons[0].name}, ${salWeapons[1].name}, ${salWeapons[2].name} & ${salWeapons[3].name}"
- this.inline = false
- }
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
-
- }
- }
- }
-
- SplatoonOnlineMode.REGULAR -> {
- val regSched = Splatoon3ApiDataGrabber.getRegularMode(System.currentTimeMillis())
- val regMaps = regSched.regularMatchSetting.vsStages
- val regMap1 = regMaps[0]
- val regMap2 = regMaps[1]
-
- val regSched2 =
- Splatoon3ApiDataGrabber.getRegularMode(System.currentTimeMillis() + 1000 * 60 * 60 * 2)
- val regMaps2 = regSched2.regularMatchSetting.vsStages
- val regMap12 = regMaps2[0]
- val regMap22 = regMaps2[1]
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "Regular Mode"
- this.description = "[[Open on website](https://splatoon3.ink/)]"
- this.color = Color(0x18c81b)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/regular.png"
- }
-
- this.field {
- this.name = "Current (${
- TimeUtil.getTimeFromJSONTime(
- regSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(regSched.endTime, "UTC")})"
- this.value =
- "${regSched.regularMatchSetting.vsRule.name} on ${regMap1.name} & ${regMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "${
- TimeUtil.getTimeFromJSONTime(
- regSched2.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(regSched2.endTime, "UTC")}"
- this.value =
- "${regSched2.regularMatchSetting.vsRule.name} on ${regMap12.name} & ${regMap22.name}"
- this.inline = false
- }
-
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
-
- }
- }
- }
-
- SplatoonOnlineMode.SERIES -> {
- val serSched = Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis())
- val serMaps = serSched.bankaraMatchSettings!!.first().vsStages
- val serMap1 = serMaps[0]
- val serMap2 = serMaps[1]
-
- val serSched2 =
- Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis() + 1000 * 60 * 60 * 2)
- val serMaps2 = serSched2.bankaraMatchSettings!!.first().vsStages
- val serMap12 = serMaps2[0]
- val serMap22 = serMaps2[1]
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "Ranked Series Mode"
- this.description = "[[Open on website](https://splatoon3.ink/)]"
- this.color = Color(0xE14412)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/bankara.png"
- }
-
- this.field {
- this.name = "Current (${
- TimeUtil.getTimeFromJSONTime(
- serSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(serSched.endTime, "UTC")})"
- this.value =
- "${serSched.bankaraMatchSettings.first().vsRule.name} on ${serMap1.name} & ${serMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "${
- TimeUtil.getTimeFromJSONTime(
- serSched2.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(serSched2.endTime, "UTC")}"
- this.value =
- "${serSched2.bankaraMatchSettings.first().vsRule.name} on ${serMap12.name} & ${serMap22.name}"
- this.inline = false
- }
-
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
-
- }
- }
- }
-
- SplatoonOnlineMode.OPEN -> {
- val opnSched = Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis())
- val opnMaps = opnSched.bankaraMatchSettings!!.last().vsStages
- val opnMap1 = opnMaps[0]
- val opnMap2 = opnMaps[1]
-
- val opnSched2 =
- Splatoon3ApiDataGrabber.getSeriesMode(System.currentTimeMillis() + 1000 * 60 * 60 * 2)
- val opnMaps2 = opnSched2.bankaraMatchSettings!!.last().vsStages
- val opnMap12 = opnMaps2[0]
- val opnMap22 = opnMaps2[1]
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "Ranked Open Mode"
- this.description = "[[Open on website](https://splatoon3.ink/)]"
- this.color = Color(0xE14412)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/bankara.png"
- }
-
- this.field {
- this.name = "Current (${
- TimeUtil.getTimeFromJSONTime(
- opnSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(opnSched.endTime, "UTC")})"
- this.value =
- "${opnSched.bankaraMatchSettings.last().vsRule.name} on ${opnMap1.name} & ${opnMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "${
- TimeUtil.getTimeFromJSONTime(
- opnSched2.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(opnSched2.endTime, "UTC")}"
- this.value =
- "${opnSched2.bankaraMatchSettings.last().vsRule.name} on ${opnMap12.name} & ${opnMap22.name}"
- this.inline = false
- }
-
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
-
- }
- }
- }
-
- SplatoonOnlineMode.X -> {
- val xSched = Splatoon3ApiDataGrabber.getXMode(System.currentTimeMillis())
- val xMaps = xSched.xMatchSetting.vsStages
- val xMap1 = xMaps[0]
- val xMap2 = xMaps[1]
-
- val xSched2 = Splatoon3ApiDataGrabber.getXMode(System.currentTimeMillis() + 1000 * 60 * 60 * 2)
- val xMaps2 = xSched2.xMatchSetting.vsStages
- val xMap12 = xMaps2[0]
- val xMap22 = xMaps2[1]
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "X Mode"
- this.description = "[[Open on website](https://splatoon3.ink/)]"
- this.color = Color(0x0ECB93)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/x.png"
- }
-
- this.field {
- this.name = "Current (${
- TimeUtil.getTimeFromJSONTime(
- xSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(xSched.endTime, "UTC")})"
- this.value = "${xSched.xMatchSetting.vsRule.name} on ${xMap1.name} & ${xMap2.name}"
- this.inline = false
- }
-
- this.field {
- this.name = "${
- TimeUtil.getTimeFromJSONTime(
- xSched2.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTime(xSched2.endTime, "UTC")}"
- this.value =
- "${xSched2.xMatchSetting.vsRule.name} on ${xMap12.name} & ${xMap22.name}"
- this.inline = false
- }
-
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
-
- }
- }
- }
-
- SplatoonOnlineMode.SALMON_RUN -> {
- val salSched = Splatoon3ApiDataGrabber.getSalmonRun(System.currentTimeMillis())
- val salMap = salSched.setting.coopStage.name
- val salBoss = salSched.setting.boss.name
- val salWeapons = salSched.setting.weapons
-
- val salSched2 =
- Splatoon3ApiDataGrabber.getSalmonRun(System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 2)
- val salMap2 = salSched2.setting.coopStage.name
- val salBoss2 = salSched2.setting.boss.name
- val salWeapons2 = salSched2.setting.weapons
-
- this.respond {
- this.embed {
- this.author {
- this.name = "Current rotation for"
- }
- this.title = "Salmon Run"
- this.description = "[[Open on website](https://splatoon3.ink/salmonrun)]"
- this.color = Color(0xEA4F03)
-
- this.thumbnail {
- this.url = "https://static.moonleay.net/img/lilJudd/grizz.png"
- }
-
- this.field {
- this.name = "Current (${
- TimeUtil.getTimeFromJSONTimeLong(
- salSched.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTimeLong(salSched.endTime, "UTC")})"
- this.value =
- "${salBoss} on ${salMap} with ${salWeapons[0].name}, ${salWeapons[1].name}, ${salWeapons[2].name} & ${salWeapons[3].name}"
- this.inline = false
- }
-
- this.field {
- this.name = "${
- TimeUtil.getTimeFromJSONTimeLong(
- salSched2.startTime,
- "UTC"
- )
- } - ${TimeUtil.getTimeFromJSONTimeLong(salSched2.endTime, "UTC")}"
- this.value =
- "${salBoss2} on ${salMap2} with ${salWeapons2[0].name}, ${salWeapons2[1].name}, ${salWeapons2[2].name} & ${salWeapons2[3].name}"
- this.inline = false
- }
-
-
- this.timestamp = Clock.System.now()
- this.footer {
- this.text = "Data provided by splatoon3.ink"
- this.icon = "https://fedi.splatoon3.ink/favicon.png"
- }
- }
- }
- }
- }
- }
- }
- }
-
- inner class RotationArguments : Arguments() {
-
- val mode by enumChoice {
- this.name = "mode"
- this.description = "The mode you want to check the rotation for"
- this.typeName = "en_US"
- }
- }
-
-}
diff --git a/src/main/kotlin/net/moonleay/liljudd/extensions/component/SplatoonOnlineMode.kt b/src/main/kotlin/net/moonleay/liljudd/extensions/component/SplatoonOnlineMode.kt
deleted file mode 100644
index 92e587e..0000000
--- a/src/main/kotlin/net/moonleay/liljudd/extensions/component/SplatoonOnlineMode.kt
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * lilJudd
- * Copyright (C) 2024 moonleay
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-package net.moonleay.liljudd.extensions.component
-
-import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
-
-enum class SplatoonOnlineMode(override val readableName: String) : ChoiceEnum {
- ALL("All Modes"),
- REGULAR("Regular Battle"),
- SERIES("Ranked Battle (Series)"),
- OPEN("Ranked Battle (Open)"),
- X("X Battle"),
- SALMON_RUN("Salmon Run"),
-}
diff --git a/src/main/templates/net/moonleay/lilJudd/build/BuildConstants.kt b/src/main/templates/net/moonleay/lilJudd/build/BuildConstants.kt
index 73a4fdd..d75d861 100644
--- a/src/main/templates/net/moonleay/lilJudd/build/BuildConstants.kt
+++ b/src/main/templates/net/moonleay/lilJudd/build/BuildConstants.kt
@@ -1,6 +1,6 @@
/*
* lilJudd
- * Copyright (C) 2024 moonleay
+ * Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +20,11 @@ package net.moonleay.liljudd.build
internal object BuildConstants {
const val version = "${version}"
- const val creatorID = "${creatorID}"
+ const val ownerID = "${ownerID}"
const val kordVersion = "${kordversion}"
const val coroutinesVersion = "${coroutinesversion}"
const val ktorVersion = "${ktorversion}"
const val exposedVersion = "${exposedversion}"
const val postgresVersion = "${postgresversion}"
const val krontabVersion = "${krontabversion}"
- const val kotlinXSerializationVerson = "${kotlinxserializationversion}"
}