From be36cfa3996cf912ed984752165af966b300f761 Mon Sep 17 00:00:00 2001 From: STG-Allen Date: Mon, 29 Mar 2021 15:21:13 -0400 Subject: [PATCH] Remove jCenter and bintray repositories, add config option for bot status, remove config from MessageListener --- build.gradle.kts | 3 +-- src/main/kotlin/org/anvilpowered/falcon/discord/JDAUtils.kt | 4 ++-- .../kotlin/org/anvilpowered/falcon/discord/MessageListener.kt | 1 - src/main/kotlin/org/anvilpowered/falcon/util/Config.kt | 3 +++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b8ba8c1..57d0072 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,8 +13,7 @@ version = "0.1.0-SNAPSHOT" repositories { mavenCentral() - jcenter() - maven("https://kotlin.bintray.com/kotlinx") + maven("https://m2.dv8tion.net/releases") maven("https://repo.spongepowered.org/repository/maven-public/") } diff --git a/src/main/kotlin/org/anvilpowered/falcon/discord/JDAUtils.kt b/src/main/kotlin/org/anvilpowered/falcon/discord/JDAUtils.kt index 480ef2c..a6e3a76 100644 --- a/src/main/kotlin/org/anvilpowered/falcon/discord/JDAUtils.kt +++ b/src/main/kotlin/org/anvilpowered/falcon/discord/JDAUtils.kt @@ -39,10 +39,10 @@ class JDAUtils @Inject constructor( fun setup() { bot = JDABuilder.createDefault(config.botToken) - .addEventListeners(MessageListener(config, logger, paste)) + .addEventListeners(MessageListener(logger, paste)) .build() bot.isAutoReconnect = true - bot.presence.activity = EntityBuilder.createActivity("Rule Breakers", null, Activity.ActivityType.WATCHING) + bot.presence.activity = EntityBuilder.createActivity(config.status, null, Activity.ActivityType.WATCHING) } fun teardown() = bot.shutdownNow() diff --git a/src/main/kotlin/org/anvilpowered/falcon/discord/MessageListener.kt b/src/main/kotlin/org/anvilpowered/falcon/discord/MessageListener.kt index d95e22e..951c9ed 100644 --- a/src/main/kotlin/org/anvilpowered/falcon/discord/MessageListener.kt +++ b/src/main/kotlin/org/anvilpowered/falcon/discord/MessageListener.kt @@ -36,7 +36,6 @@ import java.nio.file.Paths import java.util.zip.GZIPInputStream class MessageListener constructor( - private val config: Config, private val logger: Logger, private val paste: Paste, ) : ListenerAdapter() { diff --git a/src/main/kotlin/org/anvilpowered/falcon/util/Config.kt b/src/main/kotlin/org/anvilpowered/falcon/util/Config.kt index e78ec00..919d529 100644 --- a/src/main/kotlin/org/anvilpowered/falcon/util/Config.kt +++ b/src/main/kotlin/org/anvilpowered/falcon/util/Config.kt @@ -26,4 +26,7 @@ class Config { @Comment("\nDiscord bot token here") var botToken: String? = "" + + @Comment("\nCurrently playing status") + var status: String? = "Scanning files" }