Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
8612ef92a7 |
104 changed files with 319 additions and 648 deletions
|
@ -5,10 +5,12 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-gradle-project:
|
build-gradle-project:
|
||||||
runs-on: docker
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: apt update
|
- name: apt update
|
||||||
run: apt update
|
run: apt update
|
||||||
|
- name: apt upgrade
|
||||||
|
run: apt upgrade -y
|
||||||
- name: install prerequisits
|
- name: install prerequisits
|
||||||
run: apt install openjdk-17-jdk ca-certificates-java ssl-cert openssl ca-certificates -y
|
run: apt install openjdk-17-jdk ca-certificates-java ssl-cert openssl ca-certificates -y
|
||||||
- name: Checkout project sources
|
- name: Checkout project sources
|
||||||
|
|
|
@ -4,13 +4,15 @@
|
||||||
|
|
||||||
A Discord Bot for Splatoon Teams.
|
A Discord Bot for Splatoon Teams.
|
||||||
|
|
||||||
|
More information can be found on the [Homepage](https://liljudd.ink).
|
||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
[![Developer](https://img.shields.io/badge/moonleay-Developer-red)](https://gitlab.com/moonleay)
|
[![Developer](https://img.shields.io/badge/moonleay-Developer-red)](https://gitlab.com/moonleay)
|
||||||
|
|
||||||
## Known issues
|
## 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
|
## Commands & Features
|
||||||
|
|
||||||
|
@ -20,13 +22,12 @@ A Discord Bot for Splatoon Teams.
|
||||||
- match -- Create a new match
|
- match -- Create a new match
|
||||||
- updateroles -- Update the roles of all users
|
- updateroles -- Update the roles of all users
|
||||||
- sendplanner -- Send the planner message
|
- sendplanner -- Send the planner message
|
||||||
- rotation -- See the current rotation
|
|
||||||
- Features
|
- Features
|
||||||
- Time Planner -- Make the bot send messages and reactions into a selected channel in order to make planning easier
|
- 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
|
- 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
|
- 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.
|
##### See the [todo list](https://todo.moonleay.net/share/OmisuzgPDdsrCAXKjGrTfYzWwqNDNclOMGJWeMsi/auth?view=kanban) for more information.
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
//lilJudd version 2
|
//lilJudd version 2
|
||||||
val creatorID = 372703841151614976L
|
val ownerID = 372703841151614976L
|
||||||
group = "net.moonleay.liljudd"
|
group = "net.moonleay.liljudd"
|
||||||
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
|
version = System.getenv("CI_COMMIT_TAG")?.let { "$it-${System.getenv("CI_COMMIT_SHORT_SHA")}-prod" }
|
||||||
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
|
?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" }
|
||||||
?: "2.7.2"
|
?: "2.7.0"
|
||||||
|
|
||||||
val kordver = "1.7.1-SNAPSHOT"
|
val kordver = "1.7.1-SNAPSHOT"
|
||||||
val coroutinesver = "1.7.3"
|
val coroutinesver = "1.7.3"
|
||||||
|
@ -120,7 +120,7 @@ val templateSrc = project.rootDir.resolve("src/main/templates")
|
||||||
val templateDest = project.projectDir.resolve("build/generated/templates")
|
val templateDest = project.projectDir.resolve("build/generated/templates")
|
||||||
val templateProps = mapOf(
|
val templateProps = mapOf(
|
||||||
"version" to project.version as String,
|
"version" to project.version as String,
|
||||||
"creatorID" to creatorID,
|
"ownerID" to ownerID,
|
||||||
"kordversion" to kordver,
|
"kordversion" to kordver,
|
||||||
"coroutinesversion" to coroutinesver,
|
"coroutinesversion" to coroutinesver,
|
||||||
"ktorversion" to ktorver,
|
"ktorversion" to ktorver,
|
||||||
|
|
|
@ -16,10 +16,9 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd
|
package net.moonleay.lilJudd
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.ExtensibleBot
|
import com.kotlindiscord.kord.extensions.ExtensibleBot
|
||||||
import com.kotlindiscord.kord.extensions.utils.dm
|
|
||||||
import dev.kord.common.entity.PresenceStatus
|
import dev.kord.common.entity.PresenceStatus
|
||||||
import dev.kord.core.behavior.interaction.response.respond
|
import dev.kord.core.behavior.interaction.response.respond
|
||||||
import dev.kord.core.event.gateway.ReadyEvent
|
import dev.kord.core.event.gateway.ReadyEvent
|
||||||
|
@ -27,28 +26,27 @@ import dev.kord.core.event.interaction.ButtonInteractionCreateEvent
|
||||||
import dev.kord.core.on
|
import dev.kord.core.on
|
||||||
import dev.kord.gateway.Intent
|
import dev.kord.gateway.Intent
|
||||||
import dev.kord.gateway.PrivilegedIntent
|
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.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import net.moonleay.lilJudd.buttons.component.EditButtonManager
|
||||||
|
import net.moonleay.lilJudd.data.CredentialManager
|
||||||
|
import net.moonleay.lilJudd.data.api.splatoon3ink.Splatoon3Api
|
||||||
|
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.jobs.Splatoon3ApiScheduleUpdateScheduler
|
||||||
|
import net.moonleay.lilJudd.jobs.StatusUpdater
|
||||||
|
import net.moonleay.lilJudd.jobs.component.JobManager
|
||||||
|
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.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
|
import kotlin.system.exitProcess
|
||||||
|
|
||||||
|
|
||||||
object Bot {
|
object Bot {
|
||||||
//The kord object gets set at app launch
|
//The kord object gets set at app launch
|
||||||
lateinit var bot: ExtensibleBot
|
lateinit var bot: ExtensibleBot
|
||||||
|
@ -74,7 +72,6 @@ object Bot {
|
||||||
exitProcess(3)
|
exitProcess(3)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there are api credentials
|
|
||||||
if (CredentialManager.apiDomain == "empty" || CredentialManager.apiToken == "empty") {
|
if (CredentialManager.apiDomain == "empty" || CredentialManager.apiToken == "empty") {
|
||||||
Logger.out("The config does not contain the whole API credentials.")
|
Logger.out("The config does not contain the whole API credentials.")
|
||||||
exitProcess(3)
|
exitProcess(3)
|
||||||
|
@ -128,26 +125,11 @@ object Bot {
|
||||||
+Intent.GuildMembers
|
+Intent.GuildMembers
|
||||||
}
|
}
|
||||||
|
|
||||||
errorResponse { _, type ->
|
// Will add Sharding someday, I promise
|
||||||
val stamp = System.currentTimeMillis()
|
/*
|
||||||
this.embed {
|
sharding { recommended ->
|
||||||
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 ->
|
|
||||||
Shards(recommended)
|
Shards(recommended)
|
||||||
}
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register button presses
|
// Register button presses
|
||||||
|
@ -185,39 +167,13 @@ object Bot {
|
||||||
bot.kordRef.on<ReadyEvent> {
|
bot.kordRef.on<ReadyEvent> {
|
||||||
AvailabilityManager.runThread() // Update Availabilities
|
AvailabilityManager.runThread() // Update Availabilities
|
||||||
MatchManager.update() // Update Matches
|
MatchManager.update() // Update Matches
|
||||||
// Load news
|
|
||||||
NewsManager.load()
|
|
||||||
if(NewsManager.shouldPost == "yes"){
|
|
||||||
val contactedOwners = mutableListOf<ULong>()
|
|
||||||
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
|
// 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
|
// Update the Splatoon 3 api data and make sure it stays up-to-date
|
||||||
// Splatoon3Api.updateSchedule()
|
Splatoon3Api.updateSchedule()
|
||||||
// JobManager.addJob(Splatoon3ApiScheduleUpdateScheduler)
|
JobManager.addJob(Splatoon3ApiScheduleUpdateScheduler)
|
||||||
/*
|
/*
|
||||||
Other caches will be added when implemented
|
Other caches will be added when implemented
|
||||||
its not used yet in order to reduce load on the api,
|
its not used yet in order to reduce load on the api,
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* 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
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package net.moonleay.liljudd
|
package net.moonleay.lilJudd
|
||||||
|
|
||||||
import net.moonleay.liljudd.build.BuildConstants
|
import net.moonleay.liljudd.build.BuildConstants
|
||||||
import net.moonleay.liljudd.util.Logger
|
|
||||||
|
|
||||||
|
|
||||||
suspend fun main() {
|
suspend fun main() {
|
||||||
|
@ -28,11 +27,9 @@ suspend fun main() {
|
||||||
"| |_| |__| |_ _ _| |_| |\n" +
|
"| |_| |__| |_ _ _| |_| |\n" +
|
||||||
"| | | | | | | | . | . |\n" +
|
"| | | | | | | | . | . |\n" +
|
||||||
"|_|_|_|_____|___|___|___|\n" +
|
"|_|_|_|_____|___|___|___|\n" +
|
||||||
"v.${BuildConstants.version}\n"
|
" "
|
||||||
)
|
)
|
||||||
|
println("v.${BuildConstants.version}")
|
||||||
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")
|
|
||||||
|
|
||||||
Bot.start()
|
Bot.start()
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,14 +16,14 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.AcceptEditButton
|
||||||
import net.moonleay.liljudd.buttons.matchplanner.CancelEditButton
|
import net.moonleay.lilJudd.buttons.matchplanner.CancelEditButton
|
||||||
import net.moonleay.liljudd.buttons.matchplanner.DeclineEditButton
|
import net.moonleay.lilJudd.buttons.matchplanner.DeclineEditButton
|
||||||
import net.moonleay.liljudd.buttons.timeplanner.IsAvailableEditButton
|
import net.moonleay.lilJudd.buttons.timeplanner.IsAvailableEditButton
|
||||||
import net.moonleay.liljudd.buttons.timeplanner.MaybeAvailableEditButton
|
import net.moonleay.lilJudd.buttons.timeplanner.MaybeAvailableEditButton
|
||||||
import net.moonleay.liljudd.buttons.timeplanner.NotAvailableEditButton
|
import net.moonleay.lilJudd.buttons.timeplanner.NotAvailableEditButton
|
||||||
|
|
||||||
object EditButtonManager {
|
object EditButtonManager {
|
||||||
val buttons = listOf(
|
val buttons = listOf(
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.component
|
package net.moonleay.lilJudd.buttons.component
|
||||||
|
|
||||||
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
||||||
import dev.kord.core.entity.Guild
|
import dev.kord.core.entity.Guild
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.matchplanner
|
package net.moonleay.lilJudd.buttons.matchplanner
|
||||||
|
|
||||||
import dev.kord.common.entity.Snowflake
|
import dev.kord.common.entity.Snowflake
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
|
@ -27,12 +27,12 @@ import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
|
|
||||||
class AcceptEditButton : IEditButton {
|
class AcceptEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.matchmanagement.accept"
|
override val id: String = "public.edit.btn.matchmanagement.accept"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.matchplanner
|
package net.moonleay.lilJudd.buttons.matchplanner
|
||||||
|
|
||||||
import dev.kord.common.entity.Snowflake
|
import dev.kord.common.entity.Snowflake
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
|
@ -27,11 +27,11 @@ import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
|
|
||||||
class CancelEditButton : IEditButton {
|
class CancelEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.matchmanagement.cancel"
|
override val id: String = "public.edit.btn.matchmanagement.cancel"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.matchplanner
|
package net.moonleay.lilJudd.buttons.matchplanner
|
||||||
|
|
||||||
import dev.kord.common.entity.Snowflake
|
import dev.kord.common.entity.Snowflake
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
|
@ -27,12 +27,12 @@ import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
|
|
||||||
class DeclineEditButton : IEditButton {
|
class DeclineEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.matchmanagement.decline"
|
override val id: String = "public.edit.btn.matchmanagement.decline"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.timeplanner
|
package net.moonleay.lilJudd.buttons.timeplanner
|
||||||
|
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
||||||
|
@ -25,10 +25,10 @@ import dev.kord.core.entity.User
|
||||||
import dev.kord.core.entity.channel.MessageChannel
|
import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.features.AvailabilityManager
|
import net.moonleay.lilJudd.features.AvailabilityManager
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class IsAvailableEditButton : IEditButton {
|
class IsAvailableEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.timemanagement.available"
|
override val id: String = "public.edit.btn.timemanagement.available"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.timeplanner
|
package net.moonleay.lilJudd.buttons.timeplanner
|
||||||
|
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
||||||
|
@ -25,10 +25,10 @@ import dev.kord.core.entity.User
|
||||||
import dev.kord.core.entity.channel.MessageChannel
|
import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.features.AvailabilityManager
|
import net.moonleay.lilJudd.features.AvailabilityManager
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class MaybeAvailableEditButton : IEditButton {
|
class MaybeAvailableEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.timemanagement.maybeavailable"
|
override val id: String = "public.edit.btn.timemanagement.maybeavailable"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.buttons.timeplanner
|
package net.moonleay.lilJudd.buttons.timeplanner
|
||||||
|
|
||||||
import dev.kord.core.behavior.edit
|
import dev.kord.core.behavior.edit
|
||||||
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
import dev.kord.core.behavior.interaction.response.PublicMessageInteractionResponseBehavior
|
||||||
|
@ -25,10 +25,10 @@ import dev.kord.core.entity.User
|
||||||
import dev.kord.core.entity.channel.MessageChannel
|
import dev.kord.core.entity.channel.MessageChannel
|
||||||
import dev.kord.core.entity.interaction.ButtonInteraction
|
import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.buttons.component.IEditButton
|
import net.moonleay.lilJudd.buttons.component.IEditButton
|
||||||
import net.moonleay.liljudd.features.AvailabilityManager
|
import net.moonleay.lilJudd.features.AvailabilityManager
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class NotAvailableEditButton : IEditButton {
|
class NotAvailableEditButton : IEditButton {
|
||||||
override val id: String = "public.edit.btn.timemanagement.notavailable"
|
override val id: String = "public.edit.btn.timemanagement.notavailable"
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data
|
package net.moonleay.lilJudd.data
|
||||||
|
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.util.*
|
import java.util.*
|
|
@ -16,12 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink
|
package net.moonleay.lilJudd.data.api.splatoon3ink
|
||||||
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
import net.moonleay.lilJudd.data.api.splatoon3ink.schedules.Schedules
|
||||||
|
import net.moonleay.lilJudd.util.NetUtil
|
||||||
import net.moonleay.liljudd.build.BuildConstants
|
import net.moonleay.liljudd.build.BuildConstants
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.schedules.Schedules
|
|
||||||
import net.moonleay.liljudd.util.NetUtil
|
|
||||||
|
|
||||||
object Splatoon3Api {
|
object Splatoon3Api {
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink
|
package net.moonleay.lilJudd.data.api.splatoon3ink
|
||||||
|
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.schedules.BankaraNode
|
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.RegularNode
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.schedules.SalmonRunNode
|
import net.moonleay.lilJudd.data.api.splatoon3ink.schedules.SalmonRunNode
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.schedules.XNode
|
import net.moonleay.lilJudd.data.api.splatoon3ink.schedules.XNode
|
||||||
import net.moonleay.liljudd.util.TimeUtil
|
import net.moonleay.lilJudd.util.TimeUtil
|
||||||
|
|
||||||
object Splatoon3ApiDataGrabber {
|
object Splatoon3ApiDataGrabber {
|
||||||
fun getRegularMode(timestamp: Long): RegularNode {
|
fun getRegularMode(timestamp: Long): RegularNode {
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
|
@ -25,7 +25,7 @@ import kotlinx.serialization.Serializable
|
||||||
@Serializable
|
@Serializable
|
||||||
data class CoopGroupingSchedule(
|
data class CoopGroupingSchedule(
|
||||||
@SerialName("bannerImage")
|
@SerialName("bannerImage")
|
||||||
val bannerImage: BannerImage?, // is null
|
val bannerImage: String?, // is null
|
||||||
@SerialName("bigRunSchedules")
|
@SerialName("bigRunSchedules")
|
||||||
val bigRunSchedules: BigRunSchedules,
|
val bigRunSchedules: BigRunSchedules,
|
||||||
@SerialName("regularSchedules")
|
@SerialName("regularSchedules")
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,14 +16,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
// TODO: Please check what goes here.
|
||||||
data class TeamContestSchedules(
|
data class TeamContestSchedules(
|
||||||
@SerialName("nodes")
|
@SerialName("nodes")
|
||||||
val nodes: List<TeamContestNode> // This is a placeholder.
|
val nodes: List<Int> // This is a placeholder.
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.api.splatoon3ink.schedules
|
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
|
||||||
|
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,13 +16,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.MatchPlanningData
|
||||||
import net.moonleay.liljudd.data.database.tables.PlanningNotifierRoles
|
import net.moonleay.lilJudd.data.database.tables.PlanningNotifierRoles
|
||||||
import net.moonleay.liljudd.data.database.tables.TimePlanningChannels
|
import net.moonleay.lilJudd.data.database.tables.TimePlanningChannels
|
||||||
import net.moonleay.liljudd.data.database.tables.TimePlanningMessages
|
import net.moonleay.lilJudd.data.database.tables.TimePlanningMessages
|
||||||
import org.jetbrains.exposed.sql.Database
|
import org.jetbrains.exposed.sql.Database
|
||||||
import org.jetbrains.exposed.sql.SchemaUtils
|
import org.jetbrains.exposed.sql.SchemaUtils
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.entry
|
package net.moonleay.lilJudd.data.database.entry
|
||||||
|
|
||||||
data class MatchPlanningDataData(
|
data class MatchPlanningDataData(
|
||||||
val id: Int,
|
val id: Int,
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.entry
|
package net.moonleay.lilJudd.data.database.entry
|
||||||
|
|
||||||
data class PlanningNotifierRolesData(
|
data class PlanningNotifierRolesData(
|
||||||
val id: Int, // The id of the entry
|
val id: Int, // The id of the entry
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.entry
|
package net.moonleay.lilJudd.data.database.entry
|
||||||
|
|
||||||
data class TimePlanningChannelsData(
|
data class TimePlanningChannelsData(
|
||||||
val id: Int,
|
val id: Int,
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.entry
|
package net.moonleay.lilJudd.data.database.entry
|
||||||
|
|
||||||
data class TimePlanningMessagesData(
|
data class TimePlanningMessagesData(
|
||||||
val id: Int, // The id of the entry
|
val id: Int, // The id of the entry
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,15 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.entry.MatchPlanningDataData
|
||||||
import net.moonleay.liljudd.data.database.tables.MatchPlanningData
|
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.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
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
|
||||||
object MatchPlanningDataRepository {
|
object MatchPlanningDataRepository {
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,15 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.entry.PlanningNotifierRolesData
|
||||||
import net.moonleay.liljudd.data.database.tables.PlanningNotifierRoles
|
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.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
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
|
||||||
object PlanningNotifierRolesRepository {
|
object PlanningNotifierRolesRepository {
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,15 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.entry.TimePlanningChannelsData
|
||||||
import net.moonleay.liljudd.data.database.tables.TimePlanningChannels
|
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.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
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
|
||||||
object TimePlanningChannelsRepository {
|
object TimePlanningChannelsRepository {
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,13 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
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.entry.TimePlanningMessagesData
|
||||||
import net.moonleay.liljudd.data.database.tables.TimePlanningMessages
|
import net.moonleay.lilJudd.data.database.tables.TimePlanningMessages
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.sql.*
|
||||||
import org.jetbrains.exposed.sql.insert
|
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||||
import org.jetbrains.exposed.sql.selectAll
|
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
|
||||||
object TimePlanningMessagesRepository {
|
object TimePlanningMessagesRepository {
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.tables
|
package net.moonleay.lilJudd.data.database.tables
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Table
|
import org.jetbrains.exposed.sql.Table
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.tables
|
package net.moonleay.lilJudd.data.database.tables
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Table
|
import org.jetbrains.exposed.sql.Table
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.tables
|
package net.moonleay.lilJudd.data.database.tables
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Table
|
import org.jetbrains.exposed.sql.Table
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.data.database.tables
|
package net.moonleay.lilJudd.data.database.tables
|
||||||
|
|
||||||
import org.jetbrains.exposed.sql.Table
|
import org.jetbrains.exposed.sql.Table
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.Arguments
|
import com.kotlindiscord.kord.extensions.commands.Arguments
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
||||||
|
@ -26,12 +26,12 @@ import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import com.kotlindiscord.kord.extensions.utils.hasPermission
|
import com.kotlindiscord.kord.extensions.utils.hasPermission
|
||||||
import dev.kord.common.entity.Permission
|
import dev.kord.common.entity.Permission
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.extensions.component.EnableOrDisable
|
import net.moonleay.lilJudd.extensions.component.EnableOrDisable
|
||||||
import net.moonleay.liljudd.features.component.FeatureEnum
|
import net.moonleay.lilJudd.features.component.FeatureEnum
|
||||||
import net.moonleay.liljudd.features.component.FeatureManager
|
import net.moonleay.lilJudd.features.component.FeatureManager
|
||||||
import net.moonleay.liljudd.util.EmbedColor
|
import net.moonleay.lilJudd.util.EmbedColor
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
|
|
||||||
class FeatureManageExtension : Extension() {
|
class FeatureManageExtension : Extension() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,13 +16,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.extensions.Extension
|
import com.kotlindiscord.kord.extensions.extensions.Extension
|
||||||
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
|
import net.moonleay.lilJudd.util.EmbedColor
|
||||||
import net.moonleay.liljudd.build.BuildConstants
|
import net.moonleay.liljudd.build.BuildConstants
|
||||||
import net.moonleay.liljudd.util.EmbedColor
|
|
||||||
|
|
||||||
class InfoExtension : Extension() {
|
class InfoExtension : Extension() {
|
||||||
override val name = "info"
|
override val name = "info"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.Arguments
|
import com.kotlindiscord.kord.extensions.commands.Arguments
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
||||||
|
@ -26,15 +26,15 @@ import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import dev.kord.core.behavior.createRole
|
import dev.kord.core.behavior.createRole
|
||||||
import dev.kord.rest.builder.message.actionRow
|
import dev.kord.rest.builder.message.actionRow
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.data.database.entry.MatchPlanningDataData
|
import net.moonleay.lilJudd.data.database.entry.MatchPlanningDataData
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.extensions.component.MatchTypes
|
import net.moonleay.lilJudd.extensions.component.MatchTypes
|
||||||
import net.moonleay.liljudd.jobs.MatchJob
|
import net.moonleay.lilJudd.jobs.MatchJob
|
||||||
import net.moonleay.liljudd.jobs.component.JobManager
|
import net.moonleay.lilJudd.jobs.component.JobManager
|
||||||
import net.moonleay.liljudd.util.EmbedColor
|
import net.moonleay.lilJudd.util.EmbedColor
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
import net.moonleay.liljudd.util.TimeUtil
|
import net.moonleay.lilJudd.util.TimeUtil
|
||||||
|
|
||||||
class MatchExtension : Extension() {
|
class MatchExtension : Extension() {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.Arguments
|
import com.kotlindiscord.kord.extensions.commands.Arguments
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.impl.enumChoice
|
||||||
|
@ -25,9 +25,9 @@ import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import dev.kord.common.Color
|
import dev.kord.common.Color
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import kotlinx.datetime.Clock
|
import kotlinx.datetime.Clock
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
|
import net.moonleay.lilJudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
|
||||||
import net.moonleay.liljudd.extensions.component.SplatoonOnlineMode
|
import net.moonleay.lilJudd.extensions.component.SplatoonOnlineMode
|
||||||
import net.moonleay.liljudd.util.TimeUtil
|
import net.moonleay.lilJudd.util.TimeUtil
|
||||||
|
|
||||||
class RotationExtension : Extension() {
|
class RotationExtension : Extension() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.extensions.Extension
|
import com.kotlindiscord.kord.extensions.extensions.Extension
|
||||||
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
|
@ -26,10 +26,10 @@ import dev.kord.core.behavior.channel.createMessage
|
||||||
import dev.kord.rest.builder.message.actionRow
|
import dev.kord.rest.builder.message.actionRow
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
|
import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
|
||||||
import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
|
import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
|
||||||
import net.moonleay.liljudd.util.*
|
import net.moonleay.lilJudd.util.*
|
||||||
import java.time.ZoneId
|
import java.time.ZoneId
|
||||||
import java.time.ZonedDateTime
|
import java.time.ZonedDateTime
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,17 +16,17 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions
|
package net.moonleay.lilJudd.extensions
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.extensions.Extension
|
import com.kotlindiscord.kord.extensions.extensions.Extension
|
||||||
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import com.kotlindiscord.kord.extensions.utils.hasPermission
|
import com.kotlindiscord.kord.extensions.utils.hasPermission
|
||||||
import dev.kord.common.entity.Permission
|
import dev.kord.common.entity.Permission
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import net.moonleay.liljudd.features.AvailabilityManager
|
import net.moonleay.lilJudd.features.AvailabilityManager
|
||||||
import net.moonleay.liljudd.util.EmbedColor
|
import net.moonleay.lilJudd.util.EmbedColor
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
|
|
||||||
class UpdateRolesExtension : Extension() {
|
class UpdateRolesExtension : Extension() {
|
||||||
override val name = "updateroles"
|
override val name = "updateroles"
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions.component
|
package net.moonleay.lilJudd.extensions.component
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions.component
|
package net.moonleay.lilJudd.extensions.component
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.extensions.component
|
package net.moonleay.lilJudd.extensions.component
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features
|
package net.moonleay.lilJudd.features
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.utils.isNullOrBot
|
import com.kotlindiscord.kord.extensions.utils.isNullOrBot
|
||||||
import dev.inmo.krontab.buildSchedule
|
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.core.entity.channel.MessageChannel
|
||||||
import dev.kord.gateway.PrivilegedIntent
|
import dev.kord.gateway.PrivilegedIntent
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.database.entry.PlanningNotifierRolesData
|
import net.moonleay.lilJudd.data.database.entry.PlanningNotifierRolesData
|
||||||
import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
|
import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
|
||||||
import net.moonleay.liljudd.data.database.repository.PlanningNotifierRolesRepository
|
import net.moonleay.lilJudd.data.database.repository.PlanningNotifierRolesRepository
|
||||||
import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
|
import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
|
||||||
import net.moonleay.liljudd.extensions.FeatureManageExtension
|
import net.moonleay.lilJudd.extensions.FeatureManageExtension
|
||||||
import net.moonleay.liljudd.features.component.FeatureEnum
|
import net.moonleay.lilJudd.features.component.FeatureEnum
|
||||||
import net.moonleay.liljudd.features.component.IFeature
|
import net.moonleay.lilJudd.features.component.IFeature
|
||||||
import net.moonleay.liljudd.util.*
|
import net.moonleay.lilJudd.util.*
|
||||||
import java.time.ZonedDateTime
|
import java.time.ZonedDateTime
|
||||||
|
|
||||||
object AvailabilityManager : IFeature {
|
object AvailabilityManager : IFeature {
|
||||||
|
|
||||||
// This runs during the cronjob.
|
// This runs during the cronjob.
|
||||||
suspend fun runThread() {
|
suspend fun runThread() {
|
||||||
Logger.out("Updating match roles")
|
Logger.out("Starting to update roles...")
|
||||||
|
|
||||||
// ChannelID, Data
|
// ChannelID, Data
|
||||||
val messages = TimePlanningMessagesRepository.getWeek(TimeUtil.getWeekStamp().toEpochSecond())
|
val messages = TimePlanningMessagesRepository.getWeek(TimeUtil.getWeekStamp().toEpochSecond())
|
||||||
|
@ -70,7 +70,7 @@ object AvailabilityManager : IFeature {
|
||||||
}
|
}
|
||||||
this.updateInChannel(snf, data, roleData)
|
this.updateInChannel(snf, data, roleData)
|
||||||
}
|
}
|
||||||
Logger.out("Finished updating roles")
|
Logger.out("Done! Until tomorrow! <3 ")
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun updateInChannel(snf: Snowflake) {
|
suspend fun updateInChannel(snf: Snowflake) {
|
||||||
|
@ -162,7 +162,7 @@ object AvailabilityManager : IFeature {
|
||||||
|
|
||||||
// Register the cronjob to run at 1AM UTC every day
|
// Register the cronjob to run at 1AM UTC every day
|
||||||
override suspend fun registerThread() {
|
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
|
val scheduler = buildSchedule("0 0 2 * * *") // 0 0 4 * * * 0o 1w // 0o is UTC
|
||||||
scheduler.doInfinity {
|
scheduler.doInfinity {
|
||||||
this.runThread()
|
this.runThread()
|
||||||
|
@ -176,7 +176,7 @@ object AvailabilityManager : IFeature {
|
||||||
ch: Channel,
|
ch: Channel,
|
||||||
args: FeatureManageExtension.FeatureManagerArgs
|
args: FeatureManageExtension.FeatureManagerArgs
|
||||||
): EmbedBuilder {
|
): EmbedBuilder {
|
||||||
val alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
|
var alreadyExists = PlanningNotifierRolesRepository.existsInChannel(cID)
|
||||||
// Check if the channel and guild already exist in the db
|
// Check if the channel and guild already exist in the db
|
||||||
if (!alreadyExists) {
|
if (!alreadyExists) {
|
||||||
// Create the roles in Discord
|
// Create the roles in Discord
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,19 +16,19 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features
|
package net.moonleay.lilJudd.features
|
||||||
|
|
||||||
import dev.kord.common.entity.Snowflake
|
import dev.kord.common.entity.Snowflake
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.database.entry.MatchPlanningDataData
|
import net.moonleay.lilJudd.data.database.entry.MatchPlanningDataData
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.jobs.MatchJob
|
import net.moonleay.lilJudd.jobs.MatchJob
|
||||||
import net.moonleay.liljudd.jobs.component.JobManager
|
import net.moonleay.lilJudd.jobs.component.JobManager
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
|
|
||||||
object MatchManager {
|
object MatchManager {
|
||||||
suspend fun update() {
|
suspend fun update() {
|
||||||
Logger.out("Updating matches")
|
Logger.out("Updating match roles...")
|
||||||
val dataList = MatchPlanningDataRepository.getAll()
|
val dataList = MatchPlanningDataRepository.getAll()
|
||||||
|
|
||||||
for (data in dataList) {
|
for (data in dataList) {
|
||||||
|
@ -41,7 +41,7 @@ object MatchManager {
|
||||||
}
|
}
|
||||||
this.registerJob(data)
|
this.registerJob(data)
|
||||||
}
|
}
|
||||||
Logger.out("Finished updating matches")
|
Logger.out("Done. Until next time! <3 ")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun registerJob(data: MatchPlanningDataData) {
|
private fun registerJob(data: MatchPlanningDataData) {
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features
|
package net.moonleay.lilJudd.features
|
||||||
|
|
||||||
import dev.inmo.krontab.buildSchedule
|
import dev.inmo.krontab.buildSchedule
|
||||||
import dev.inmo.krontab.doInfinity
|
import dev.inmo.krontab.doInfinity
|
||||||
|
@ -29,19 +29,19 @@ import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import dev.kord.rest.builder.message.actionRow
|
import dev.kord.rest.builder.message.actionRow
|
||||||
import dev.kord.rest.builder.message.embed
|
import dev.kord.rest.builder.message.embed
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.database.entry.TimePlanningChannelsData
|
import net.moonleay.lilJudd.data.database.entry.TimePlanningChannelsData
|
||||||
import net.moonleay.liljudd.data.database.entry.TimePlanningMessagesData
|
import net.moonleay.lilJudd.data.database.entry.TimePlanningMessagesData
|
||||||
import net.moonleay.liljudd.data.database.repository.PlanningNotifierRolesRepository
|
import net.moonleay.lilJudd.data.database.repository.PlanningNotifierRolesRepository
|
||||||
import net.moonleay.liljudd.data.database.repository.TimePlanningChannelsRepository
|
import net.moonleay.lilJudd.data.database.repository.TimePlanningChannelsRepository
|
||||||
import net.moonleay.liljudd.data.database.repository.TimePlanningMessagesRepository
|
import net.moonleay.lilJudd.data.database.repository.TimePlanningMessagesRepository
|
||||||
import net.moonleay.liljudd.extensions.FeatureManageExtension
|
import net.moonleay.lilJudd.extensions.FeatureManageExtension
|
||||||
import net.moonleay.liljudd.features.component.FeatureEnum
|
import net.moonleay.lilJudd.features.component.FeatureEnum
|
||||||
import net.moonleay.liljudd.features.component.IFeature
|
import net.moonleay.lilJudd.features.component.IFeature
|
||||||
import net.moonleay.liljudd.util.EmbedColor
|
import net.moonleay.lilJudd.util.EmbedColor
|
||||||
import net.moonleay.liljudd.util.EmbedUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import net.moonleay.liljudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
import java.time.ZoneId
|
import java.time.ZoneId
|
||||||
import java.time.ZonedDateTime
|
import java.time.ZonedDateTime
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ object TimeManager : IFeature {
|
||||||
|
|
||||||
// Register the cronjob to run at 0:01 AM UTC every Monday
|
// Register the cronjob to run at 0:01 AM UTC every Monday
|
||||||
override suspend fun registerThread() {
|
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
|
val scheduler = buildSchedule("0 0 1 * * * 0o 1w") // 0 0 4 * * * 0o 1w // 0o is UTC
|
||||||
scheduler.doInfinity {
|
scheduler.doInfinity {
|
||||||
this.runThread()
|
this.runThread()
|
||||||
|
@ -60,7 +60,7 @@ object TimeManager : IFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun runThread() {
|
private suspend fun runThread() {
|
||||||
Logger.out("Starting to send out weekly planning messages")
|
Logger.out("Starting to notify...")
|
||||||
|
|
||||||
// ChannelID -> Data
|
// ChannelID -> Data
|
||||||
val targetedChannels = TimePlanningChannelsRepository.getAll().associateBy { it.channelID }
|
val targetedChannels = TimePlanningChannelsRepository.getAll().associateBy { it.channelID }
|
||||||
|
@ -72,7 +72,7 @@ object TimeManager : IFeature {
|
||||||
for (ch2 in targetedChannels.keys) {
|
for (ch2 in targetedChannels.keys) {
|
||||||
val ch = Snowflake(ch2)
|
val ch = Snowflake(ch2)
|
||||||
if (Bot.bot.kordRef.getChannel(ch) == null)
|
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<MessageChannel>(ch)!!
|
val c = Bot.bot.kordRef.getChannelOf<MessageChannel>(ch)!!
|
||||||
msgStr = ""
|
msgStr = ""
|
||||||
if (targetedRoles != null && targetedRoles.keys.contains(ch2) && targetedRoles[ch2] != null) {
|
if (targetedRoles != null && targetedRoles.keys.contains(ch2) && targetedRoles[ch2] != null) {
|
||||||
|
@ -133,7 +133,7 @@ object TimeManager : IFeature {
|
||||||
}
|
}
|
||||||
msgStr += "${it}:${msg.id.value};"
|
msgStr += "${it}:${msg.id.value};"
|
||||||
then = then.plusDays(1).withHour(4).withMinute(0).withSecond(0)
|
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)
|
delay(1000)
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ object TimeManager : IFeature {
|
||||||
): EmbedBuilder {
|
): EmbedBuilder {
|
||||||
// Check if entry exists in db
|
// Check if entry exists in db
|
||||||
if (TimePlanningChannelsRepository.exists(cID, gID)) {
|
if (TimePlanningChannelsRepository.exists(cID, gID)) {
|
||||||
// delete all entries for this channel
|
// delete all entrys for this channel
|
||||||
TimePlanningChannelsRepository.deleteFromChannelInServer(cID, gID)
|
TimePlanningChannelsRepository.deleteFromChannelInServer(cID, gID)
|
||||||
return MessageUtil.getEmbed(
|
return MessageUtil.getEmbed(
|
||||||
EmbedColor.SUCCESS,
|
EmbedColor.SUCCESS,
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features.component
|
package net.moonleay.lilJudd.features.component
|
||||||
|
|
||||||
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
import com.kotlindiscord.kord.extensions.commands.application.slash.converters.ChoiceEnum
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,10 +16,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features.component
|
package net.moonleay.lilJudd.features.component
|
||||||
|
|
||||||
import net.moonleay.liljudd.features.AvailabilityManager
|
import net.moonleay.lilJudd.features.AvailabilityManager
|
||||||
import net.moonleay.liljudd.features.TimeManager
|
import net.moonleay.lilJudd.features.TimeManager
|
||||||
|
|
||||||
object FeatureManager {
|
object FeatureManager {
|
||||||
val features = mutableListOf(AvailabilityManager, TimeManager) // Stores all features
|
val features = mutableListOf(AvailabilityManager, TimeManager) // Stores all features
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,12 +16,12 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.features.component
|
package net.moonleay.lilJudd.features.component
|
||||||
|
|
||||||
import dev.kord.core.behavior.UserBehavior
|
import dev.kord.core.behavior.UserBehavior
|
||||||
import dev.kord.core.entity.channel.Channel
|
import dev.kord.core.entity.channel.Channel
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
import net.moonleay.liljudd.extensions.FeatureManageExtension
|
import net.moonleay.lilJudd.extensions.FeatureManageExtension
|
||||||
|
|
||||||
interface IFeature {
|
interface IFeature {
|
||||||
val feat: FeatureEnum
|
val feat: FeatureEnum
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,17 +16,17 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs
|
package net.moonleay.lilJudd.jobs
|
||||||
|
|
||||||
import dev.inmo.krontab.KronScheduler
|
import dev.inmo.krontab.KronScheduler
|
||||||
import dev.kord.common.entity.Snowflake
|
import dev.kord.common.entity.Snowflake
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.database.repository.MatchPlanningDataRepository
|
import net.moonleay.lilJudd.data.database.repository.MatchPlanningDataRepository
|
||||||
import net.moonleay.liljudd.jobs.component.CronjobType
|
import net.moonleay.lilJudd.jobs.component.CronjobType
|
||||||
import net.moonleay.liljudd.jobs.component.ICronjob
|
import net.moonleay.lilJudd.jobs.component.ICronjob
|
||||||
import net.moonleay.liljudd.jobs.component.JobManager
|
import net.moonleay.lilJudd.jobs.component.JobManager
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
|
|
||||||
class MatchJob(
|
class MatchJob(
|
||||||
override val jobIncoming: String,
|
override val jobIncoming: String,
|
|
@ -16,14 +16,14 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs
|
package net.moonleay.lilJudd.jobs
|
||||||
|
|
||||||
import dev.inmo.krontab.KronScheduler
|
import dev.inmo.krontab.KronScheduler
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3Api
|
import net.moonleay.lilJudd.data.api.splatoon3ink.Splatoon3Api
|
||||||
import net.moonleay.liljudd.jobs.component.CronjobType
|
import net.moonleay.lilJudd.jobs.component.CronjobType
|
||||||
import net.moonleay.liljudd.jobs.component.ICronjob
|
import net.moonleay.lilJudd.jobs.component.ICronjob
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
|
|
||||||
object Splatoon3ApiScheduleUpdateScheduler : ICronjob {
|
object Splatoon3ApiScheduleUpdateScheduler : ICronjob {
|
||||||
override val jobName: String
|
override val jobName: String
|
|
@ -16,15 +16,15 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs
|
package net.moonleay.lilJudd.jobs
|
||||||
|
|
||||||
import dev.inmo.krontab.KronScheduler
|
import dev.inmo.krontab.KronScheduler
|
||||||
import dev.kord.common.entity.PresenceStatus
|
import dev.kord.common.entity.PresenceStatus
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import net.moonleay.liljudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.liljudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
|
import net.moonleay.lilJudd.data.api.splatoon3ink.Splatoon3ApiDataGrabber
|
||||||
import net.moonleay.liljudd.jobs.component.CronjobType
|
import net.moonleay.lilJudd.jobs.component.CronjobType
|
||||||
import net.moonleay.liljudd.jobs.component.ICronjob
|
import net.moonleay.lilJudd.jobs.component.ICronjob
|
||||||
|
|
||||||
object StatusUpdater : ICronjob {
|
object StatusUpdater : ICronjob {
|
||||||
override val jobName: String
|
override val jobName: String
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs.component
|
package net.moonleay.lilJudd.jobs.component
|
||||||
|
|
||||||
enum class CronjobType {
|
enum class CronjobType {
|
||||||
INFINITE,
|
INFINITE,
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs.component
|
package net.moonleay.lilJudd.jobs.component
|
||||||
|
|
||||||
import dev.inmo.krontab.KronScheduler
|
import dev.inmo.krontab.KronScheduler
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.jobs.component
|
package net.moonleay.lilJudd.jobs.component
|
||||||
|
|
||||||
import dev.inmo.krontab.buildSchedule
|
import dev.inmo.krontab.buildSchedule
|
||||||
import dev.inmo.krontab.doInfinityTz
|
import dev.inmo.krontab.doInfinityTz
|
||||||
|
@ -25,7 +25,7 @@ import dev.inmo.krontab.doWhileTz
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import net.moonleay.liljudd.util.Logger
|
import net.moonleay.lilJudd.util.Logger
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import dev.kord.common.Color
|
import dev.kord.common.Color
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import dev.kord.common.entity.ButtonStyle
|
import dev.kord.common.entity.ButtonStyle
|
||||||
import dev.kord.core.entity.Embed
|
import dev.kord.core.entity.Embed
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.format.DateTimeFormatter
|
import java.time.format.DateTimeFormatter
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import dev.kord.core.behavior.UserBehavior
|
import dev.kord.core.behavior.UserBehavior
|
||||||
import dev.kord.core.entity.Embed
|
import dev.kord.core.entity.Embed
|
||||||
|
@ -37,11 +37,6 @@ object MessageUtil {
|
||||||
val ebb = EmbedBuilder()
|
val ebb = EmbedBuilder()
|
||||||
ebb.color = e.color
|
ebb.color = e.color
|
||||||
ebb.title = e.title
|
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 {
|
e.fields.forEach {
|
||||||
val fb = EmbedBuilder.Field()
|
val fb = EmbedBuilder.Field()
|
||||||
fb.name = it.name
|
fb.name = it.name
|
||||||
|
@ -49,10 +44,6 @@ object MessageUtil {
|
||||||
fb.inline = it.inline
|
fb.inline = it.inline
|
||||||
ebb.fields.add(fb)
|
ebb.fields.add(fb)
|
||||||
}
|
}
|
||||||
ebb.footer {
|
|
||||||
this.icon = e.footer?.iconUrl
|
|
||||||
this.text = e.footer?.text.toString()
|
|
||||||
}
|
|
||||||
ebb.description = e.description
|
ebb.description = e.description
|
||||||
return ebb
|
return ebb
|
||||||
}
|
}
|
||||||
|
@ -61,11 +52,6 @@ object MessageUtil {
|
||||||
val ebb = EmbedBuilder()
|
val ebb = EmbedBuilder()
|
||||||
ebb.color = e.color
|
ebb.color = e.color
|
||||||
ebb.title = e.title
|
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 {
|
e.fields.forEach {
|
||||||
val fb = EmbedBuilder.Field()
|
val fb = EmbedBuilder.Field()
|
||||||
fb.name = it.name
|
fb.name = it.name
|
||||||
|
@ -73,10 +59,6 @@ object MessageUtil {
|
||||||
fb.inline = it.inline
|
fb.inline = it.inline
|
||||||
ebb.fields.add(fb)
|
ebb.fields.add(fb)
|
||||||
}
|
}
|
||||||
ebb.footer {
|
|
||||||
this.icon = e.footer?.icon
|
|
||||||
this.text = e.footer?.text.toString()
|
|
||||||
}
|
|
||||||
ebb.description = e.description
|
ebb.description = e.description
|
||||||
return ebb
|
return ebb
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* lilJudd
|
* lilJudd
|
||||||
* Copyright (C) 2024 moonleay
|
* Copyright (C) 2023 moonleay
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import javax.net.ssl.HttpsURLConnection
|
import javax.net.ssl.HttpsURLConnection
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.moonleay.liljudd.util
|
package net.moonleay.lilJudd.util
|
||||||
|
|
||||||
import kotlinx.datetime.DayOfWeek
|
import kotlinx.datetime.DayOfWeek
|
||||||
import java.time.Duration
|
import java.time.Duration
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue