feat: started working on improving feature system, added Feature, added FeatureManager to store all Features

Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
limited_dev 2023-06-28 22:47:13 +02:00
parent 2e63bee9a6
commit 04ff442d86
2 changed files with 31 additions and 13 deletions

View file

@ -16,21 +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.features package net.moonleay.lilJudd.features.component
import dev.inmo.krontab.buildSchedule import dev.kord.core.entity.Message
import dev.inmo.krontab.doInfinity
import net.moonleay.lilJudd.util.Logger
object PlanningNotifier { interface Feature {
suspend fun registerThread() { val feature: FeatureEnum
Logger.out("Adding ping scheduler...")
val scheduler = buildSchedule("0 0 4 * * * 0o 1w") // 0 0 4 * * * 0o 1w // 0o is UTC
scheduler.doInfinity {
Logger.out("Starting to update roles...")
Logger.out("Done! Until tomorrow! <3 ") fun enable(): Message
} fun disable(): Message
} suspend fun registerThread()
} }

View file

@ -0,0 +1,24 @@
/*
* lilJudd
* Copyright (C) 2023 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.moonleay.lilJudd.features.component
object FeatureManager {
// See note in Feature.kt
val features = mutableListOf<Feature>()
}