mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-01 04:47:24 +00:00
Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
8b76a9aa9b
|
|||
bbc3288535 | |||
45ad734c7b | |||
1eaed8ce6f | |||
a624fcd37d | |||
59aa83c93e | |||
3ea0f4eacb
|
|||
d3e18d80ca
|
|||
1e0eebbd7e
|
|||
6f3c1ec592 | |||
c013dafdd7 | |||
e0bfd8796c | |||
67d561c0ab | |||
63687da0bb
|
|||
cd76249c33 | |||
5a8afd1549 | |||
651569dc8f | |||
bf2ea9a367
|
|||
540fe84f26
|
|||
712378b3ff
|
|||
961382fb56
|
|||
34d9ece6d7
|
|||
30a2cb34d5
|
|||
c94e0476b5
|
|||
6e5cd07c51
|
33
.github/dependabot.yml
vendored
Normal file
33
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-app"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-meta"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-extension"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
||||
# - package-ecosystem: "gradle"
|
||||
# directory: "/scalabot-ext-example"
|
||||
# schedule:
|
||||
# interval: "weekly"
|
36
.github/workflows/binary-compatibility-verification.yml
vendored
Normal file
36
.github/workflows/binary-compatibility-verification.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
name: Binary compatibility verification (for API)
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'scalabot-meta/**'
|
||||
- 'scalabot-extension/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'scalabot-meta/**'
|
||||
- 'scalabot-extension/**'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
apiCompatibilityCheck:
|
||||
timeout-minutes: 8
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt-hotspot'
|
||||
cache: 'gradle'
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and run binary compatibility verification
|
||||
uses: gradle/gradle-build-action@v2.4.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: apiCheck
|
2
.github/workflows/build-and-test.yml
vendored
2
.github/workflows/build-and-test.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
uses: gradle/gradle-build-action@v2.4.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: test
|
||||
|
2
.github/workflows/create-release.yml
vendored
2
.github/workflows/create-release.yml
vendored
@ -49,7 +49,7 @@ jobs:
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
uses: gradle/gradle-build-action@v2.4.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: clean test assembleDist
|
||||
|
4
.github/workflows/publish-artifacts.yml
vendored
4
.github/workflows/publish-artifacts.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build and test
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
uses: gradle/gradle-build-action@v2.4.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: clean test installDist
|
||||
@ -39,7 +39,7 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push container image
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
@ -25,7 +25,7 @@ jobs:
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build project and install Distribution package
|
||||
uses: gradle/gradle-build-action@v2.2.1
|
||||
uses: gradle/gradle-build-action@v2.4.0
|
||||
with:
|
||||
gradle-version: 'wrapper'
|
||||
arguments: installDist
|
||||
@ -39,7 +39,7 @@ jobs:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build and push container image
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
|
@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.7.10" apply false
|
||||
id("org.jetbrains.kotlinx.kover") version "0.5.1" apply false
|
||||
kotlin("jvm") version "1.8.10" apply false
|
||||
id("org.jetbrains.kotlinx.kover") version "0.6.1" apply false
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.0" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@ -12,5 +13,5 @@ allprojects {
|
||||
|
||||
}
|
||||
group = "net.lamgc"
|
||||
version = "0.5.2"
|
||||
version = "0.6.0"
|
||||
}
|
@ -10,9 +10,9 @@ dependencies {
|
||||
implementation(project(":scalabot-meta"))
|
||||
implementation(project(":scalabot-extension"))
|
||||
|
||||
implementation("org.slf4j:slf4j-api:2.0.0")
|
||||
implementation("io.github.microutils:kotlin-logging:2.1.23")
|
||||
implementation("ch.qos.logback:logback-classic:1.4.0")
|
||||
implementation("org.slf4j:slf4j-api:2.0.6")
|
||||
implementation("io.github.microutils:kotlin-logging:3.0.5")
|
||||
implementation("ch.qos.logback:logback-classic:1.4.5")
|
||||
|
||||
val aetherVersion = "1.1.0"
|
||||
implementation("org.eclipse.aether:aether-api:$aetherVersion")
|
||||
@ -24,23 +24,19 @@ dependencies {
|
||||
implementation("org.apache.maven:maven-aether-provider:3.3.9")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.20")
|
||||
implementation("com.google.code.gson:gson:2.9.0")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:1.8.10")
|
||||
implementation("com.google.code.gson:gson:2.10.1")
|
||||
|
||||
implementation("org.jdom:jdom2:2.0.6.1")
|
||||
|
||||
implementation("org.telegram:telegrambots-abilities:6.1.0")
|
||||
implementation("org.telegram:telegrambots:6.1.0")
|
||||
|
||||
// Added as a mitigation measure for vulnerabilities.
|
||||
// When the relevant reference dependency updates it, it will be removed.
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.4.2")
|
||||
implementation("org.telegram:telegrambots-abilities:6.5.0")
|
||||
implementation("org.telegram:telegrambots:6.5.0")
|
||||
|
||||
implementation("io.prometheus:simpleclient:0.16.0")
|
||||
implementation("io.prometheus:simpleclient_httpserver:0.16.0")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
testImplementation("io.mockk:mockk:1.12.7")
|
||||
testImplementation("io.mockk:mockk:1.13.4")
|
||||
testImplementation("com.github.stefanbirkner:system-lambda:1.2.1")
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@ import org.eclipse.aether.repository.Authentication
|
||||
import org.eclipse.aether.repository.Proxy
|
||||
import org.eclipse.aether.repository.RemoteRepository
|
||||
import org.eclipse.aether.repository.RepositoryPolicy
|
||||
import org.slf4j.event.Level
|
||||
import org.telegram.telegrambots.bots.DefaultBotOptions
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
@ -248,8 +249,37 @@ internal class LogDirectorySupplier : PropertyDefinerBase() {
|
||||
}
|
||||
}
|
||||
|
||||
internal class LogLevelSupplier : PropertyDefinerBase() {
|
||||
override fun getPropertyValue(): String {
|
||||
val property = System.getProperty("scalabot.log.level", System.getenv("BOT_LOG_LEVEL"))
|
||||
val level = if (property != null) {
|
||||
try {
|
||||
Level.valueOf(property.uppercase())
|
||||
} catch (e: IllegalArgumentException) {
|
||||
addWarn("Invalid log level: `$property`, the log will be output using the Info log level.")
|
||||
Level.INFO
|
||||
}
|
||||
} else {
|
||||
Level.INFO
|
||||
}
|
||||
return level.name
|
||||
}
|
||||
}
|
||||
|
||||
internal class NetworkVerboseLogSupplier : PropertyDefinerBase() {
|
||||
override fun getPropertyValue(): String {
|
||||
val propertyValue = System.getProperty("scalabot.log.network.verbose", "false")
|
||||
return if (propertyValue.toBoolean()) {
|
||||
"DEBUG"
|
||||
} else {
|
||||
"INFO"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal object Const {
|
||||
val config = loadAppConfig()
|
||||
const val METRICS_NAMESPACE = "scalabot"
|
||||
}
|
||||
|
||||
private fun AppPaths.defaultInitializer() {
|
||||
|
@ -26,6 +26,7 @@ private val log = KotlinLogging.logger { }
|
||||
fun main(args: Array<String>): Unit = runBlocking {
|
||||
log.info { "ScalaBot 正在启动中..." }
|
||||
log.info { "数据目录: ${AppPaths.DATA_ROOT}" }
|
||||
log.debug { "Kotlin: ${KotlinVersion.CURRENT}, JVM: ${Runtime.version()}" }
|
||||
log.debug { "启动参数: ${args.joinToString(prefix = "[", postfix = "]")}" }
|
||||
if (initialFiles()) {
|
||||
exitProcess(1)
|
||||
@ -61,7 +62,10 @@ internal fun startMetricsServer(config: MetricsConfig = Const.config.metrics): H
|
||||
return httpServer
|
||||
}
|
||||
|
||||
internal class Launcher(private val config: AppConfig = Const.config) : AutoCloseable {
|
||||
internal class Launcher(
|
||||
private val config: AppConfig = Const.config,
|
||||
private val configFile: File = AppPaths.CONFIG_APPLICATION.file,
|
||||
) : AutoCloseable {
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@ -75,9 +79,7 @@ internal class Launcher(private val config: AppConfig = Const.config) : AutoClos
|
||||
private fun getMavenLocalRepository(): LocalRepository {
|
||||
val localPath =
|
||||
if (config.mavenLocalRepository != null && config.mavenLocalRepository!!.isNotEmpty()) {
|
||||
val repoPath = AppPaths.DATA_ROOT.file.toPath()
|
||||
.resolve(config.mavenLocalRepository!!)
|
||||
.apply {
|
||||
val repoPath = configFile.toPath().resolve(config.mavenLocalRepository!!).apply {
|
||||
if (!exists()) {
|
||||
if (!parent.isWritable() || !parent.isReadable()) {
|
||||
throw IOException("Unable to read and write the directory where Maven repository is located.")
|
||||
|
@ -50,6 +50,8 @@ internal class ScalaBot(
|
||||
extensionFinders = extensionFinders
|
||||
)
|
||||
|
||||
private val accountIdString = accountId.toString()
|
||||
|
||||
init {
|
||||
log.info { "[Bot $botUsername] 正在加载扩展..." }
|
||||
val extensionEntries = extensionLoader.getExtensions()
|
||||
@ -66,18 +68,18 @@ internal class ScalaBot(
|
||||
override fun creatorId(): Long = creatorId
|
||||
|
||||
override fun onUpdateReceived(update: Update?) {
|
||||
botUpdateCounter.labels(botUsername).inc()
|
||||
botUpdateGauge.labels(botUsername).inc()
|
||||
botUpdateCounter.labels(botUsername, accountIdString).inc()
|
||||
botUpdateGauge.labels(botUsername, accountIdString).inc()
|
||||
|
||||
val timer = updateProcessTime.labels(botUsername).startTimer()
|
||||
val timer = updateProcessTime.labels(botUsername, accountIdString).startTimer()
|
||||
try {
|
||||
super.onUpdateReceived(update)
|
||||
} catch (e: Exception) {
|
||||
exceptionHandlingCounter.labels(botUsername).inc()
|
||||
exceptionHandlingCounter.labels(botUsername, accountIdString).inc()
|
||||
throw e
|
||||
} finally {
|
||||
timer.observeDuration()
|
||||
botUpdateGauge.labels(botUsername).dec()
|
||||
botUpdateGauge.labels(botUsername, accountIdString).dec()
|
||||
}
|
||||
}
|
||||
|
||||
@ -134,7 +136,8 @@ internal class ScalaBot(
|
||||
private val botUpdateCounter = Counter.build()
|
||||
.name("updates_total")
|
||||
.help("Total number of updates received by all bots.")
|
||||
.labelNames("bot_name")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -142,7 +145,8 @@ internal class ScalaBot(
|
||||
private val botUpdateGauge = Gauge.build()
|
||||
.name("updates_in_progress")
|
||||
.help("Number of updates in process by all bots.")
|
||||
.labelNames("bot_name")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -150,6 +154,7 @@ internal class ScalaBot(
|
||||
private val onlineBotGauge = Gauge.build()
|
||||
.name("bots_online")
|
||||
.help("Number of bots Online.")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -161,7 +166,8 @@ internal class ScalaBot(
|
||||
"so it may be different from the actual execution time of ability. " +
|
||||
"It is not recommended to use it as the accurate execution time of ability)"
|
||||
)
|
||||
.labelNames("bot_name")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
|
||||
@ -169,7 +175,8 @@ internal class ScalaBot(
|
||||
private val exceptionHandlingCounter = Counter.build()
|
||||
.name("updates_exception_handling")
|
||||
.help("Number of exceptions during processing.")
|
||||
.labelNames("bot_name")
|
||||
.labelNames("bot_name", "bot_id")
|
||||
.namespace(Const.METRICS_NAMESPACE)
|
||||
.subsystem("telegrambots")
|
||||
.register()
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<included>
|
||||
<define name="DATA_LOGS" class="net.lamgc.scalabot.LogDirectorySupplier"/>
|
||||
<define name="LOG_LEVEL" class="net.lamgc.scalabot.LogLevelSupplier"/>
|
||||
<define name="NETWORK_LOG_LEVEL" class="net.lamgc.scalabot.NetworkVerboseLogSupplier"/>
|
||||
|
||||
<appender name="STD_OUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
|
@ -1,16 +0,0 @@
|
||||
<configuration scan="false" debug="false">
|
||||
<include resource="base-logback.xml"/>
|
||||
|
||||
<logger name="org.apache.http" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultTransporterProvider" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager" level="INFO"/>
|
||||
<logger name="org.telegram.telegrambots.facilities.proxysocketfactorys" level="INFO"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultUpdateCheckManager" level="INFO"/>
|
||||
|
||||
<root level="DEBUG">
|
||||
<appender-ref ref="FILE_OUT"/>
|
||||
<appender-ref ref="STD_ERR"/>
|
||||
<appender-ref ref="STD_OUT"/>
|
||||
</root>
|
||||
</configuration>
|
@ -1,7 +1,14 @@
|
||||
<configuration scan="false" debug="false">
|
||||
<include resource="base-logback.xml"/>
|
||||
|
||||
<root level="INFO">
|
||||
<logger name="org.apache.http" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultTransporterProvider" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManager" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.telegram.telegrambots.facilities.proxysocketfactorys" level="${NETWORK_LOG_LEVEL}"/>
|
||||
<logger name="org.eclipse.aether.internal.impl.DefaultUpdateCheckManager" level="${NETWORK_LOG_LEVEL}"/>
|
||||
|
||||
<root level="${LOG_LEVEL}">
|
||||
<appender-ref ref="FILE_OUT"/>
|
||||
<appender-ref ref="STD_ERR"/>
|
||||
<appender-ref ref="STD_OUT"/>
|
||||
|
@ -5,7 +5,7 @@ plugins {
|
||||
dependencies {
|
||||
compileOnly(project(":scalabot-extension"))
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
}
|
||||
|
||||
|
9
scalabot-extension/api/scalabot-extension.api
Normal file
9
scalabot-extension/api/scalabot-extension.api
Normal file
@ -0,0 +1,9 @@
|
||||
public abstract interface class net/lamgc/scalabot/extension/BotExtensionFactory {
|
||||
public abstract fun createExtensionInstance (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;Ljava/io/File;)Lorg/telegram/abilitybots/api/util/AbilityExtension;
|
||||
}
|
||||
|
||||
public class net/lamgc/scalabot/extension/util/AbilityBots {
|
||||
public static fun cancelReplyState (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;J)Z
|
||||
public static fun getBotAccountId (Lorg/telegram/abilitybots/api/bot/BaseAbilityBot;)J
|
||||
}
|
||||
|
@ -4,20 +4,16 @@ plugins {
|
||||
jacoco
|
||||
`maven-publish`
|
||||
signing
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.11.1"
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("commons-codec:commons-codec:1.15")
|
||||
api("org.telegram:telegrambots-abilities:6.1.0")
|
||||
api("org.slf4j:slf4j-api:2.0.0")
|
||||
api("org.telegram:telegrambots-abilities:6.5.0")
|
||||
api("org.slf4j:slf4j-api:2.0.3")
|
||||
|
||||
// Added as a mitigation measure for vulnerabilities.
|
||||
// When the relevant reference dependency updates it, it will be removed.
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.4.2")
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
|
||||
testImplementation("org.mockito:mockito-core:4.7.0")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
|
||||
testImplementation("org.mockito:mockito-core:5.1.1")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
}
|
||||
|
||||
|
195
scalabot-meta/api/scalabot-meta.api
Normal file
195
scalabot-meta/api/scalabot-meta.api
Normal file
@ -0,0 +1,195 @@
|
||||
public final class net/lamgc/scalabot/config/AppConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;)V
|
||||
public synthetic fun <init> (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public final fun component2 ()Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public final fun component3 ()Ljava/util/List;
|
||||
public final fun component4 ()Ljava/lang/String;
|
||||
public final fun copy (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;)Lnet/lamgc/scalabot/config/AppConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/AppConfig;Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/MetricsConfig;Ljava/util/List;Ljava/lang/String;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/AppConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getMavenLocalRepository ()Ljava/lang/String;
|
||||
public final fun getMavenRepositories ()Ljava/util/List;
|
||||
public final fun getMetrics ()Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public final fun getProxy ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/BotAccount {
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;J)V
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
public final fun component3 ()J
|
||||
public final fun copy (Ljava/lang/String;Ljava/lang/String;J)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/BotAccount;Ljava/lang/String;Ljava/lang/String;JILjava/lang/Object;)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getCreatorId ()J
|
||||
public final fun getId ()J
|
||||
public final fun getName ()Ljava/lang/String;
|
||||
public final fun getToken ()Ljava/lang/String;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/BotConfig {
|
||||
public fun <init> (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;)V
|
||||
public synthetic fun <init> (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Z
|
||||
public final fun component2 ()Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public final fun component3 ()Z
|
||||
public final fun component4 ()Z
|
||||
public final fun component5 ()Ljava/util/Set;
|
||||
public final fun component6 ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public final fun component7 ()Ljava/lang/String;
|
||||
public final fun copy (ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/BotConfig;ZLnet/lamgc/scalabot/config/BotAccount;ZZLjava/util/Set;Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/String;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAccount ()Lnet/lamgc/scalabot/config/BotAccount;
|
||||
public final fun getAutoUpdateCommandList ()Z
|
||||
public final fun getBaseApiUrl ()Ljava/lang/String;
|
||||
public final fun getDisableBuiltInAbility ()Z
|
||||
public final fun getEnabled ()Z
|
||||
public final fun getExtensions ()Ljava/util/Set;
|
||||
public final fun getProxy ()Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/MavenRepositoryConfig {
|
||||
public fun <init> (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;)V
|
||||
public synthetic fun <init> (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Ljava/lang/String;
|
||||
public final fun component2 ()Ljava/net/URL;
|
||||
public final fun component3 ()Lorg/eclipse/aether/repository/Proxy;
|
||||
public final fun component4 ()Ljava/lang/String;
|
||||
public final fun component5 ()Z
|
||||
public final fun component6 ()Z
|
||||
public final fun component7 ()Lorg/eclipse/aether/repository/Authentication;
|
||||
public final fun copy (Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/MavenRepositoryConfig;Ljava/lang/String;Ljava/net/URL;Lorg/eclipse/aether/repository/Proxy;Ljava/lang/String;ZZLorg/eclipse/aether/repository/Authentication;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAuthentication ()Lorg/eclipse/aether/repository/Authentication;
|
||||
public final fun getEnableReleases ()Z
|
||||
public final fun getEnableSnapshots ()Z
|
||||
public final fun getId ()Ljava/lang/String;
|
||||
public final fun getLayout ()Ljava/lang/String;
|
||||
public final fun getProxy ()Lorg/eclipse/aether/repository/Proxy;
|
||||
public final fun getUrl ()Ljava/net/URL;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/MetricsConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;)V
|
||||
public synthetic fun <init> (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Z
|
||||
public final fun component2 ()I
|
||||
public final fun component3 ()Ljava/lang/String;
|
||||
public final fun component4 ()Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public final fun copy (ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;)Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/MetricsConfig;ZILjava/lang/String;Lnet/lamgc/scalabot/config/UsernameAuthenticator;ILjava/lang/Object;)Lnet/lamgc/scalabot/config/MetricsConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getAuthenticator ()Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public final fun getBindAddress ()Ljava/lang/String;
|
||||
public final fun getEnable ()Z
|
||||
public final fun getPort ()I
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/ProxyConfig {
|
||||
public fun <init> ()V
|
||||
public fun <init> (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;I)V
|
||||
public synthetic fun <init> (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||
public final fun component1 ()Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public final fun component2 ()Ljava/lang/String;
|
||||
public final fun component3 ()I
|
||||
public final fun copy (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;I)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public static synthetic fun copy$default (Lnet/lamgc/scalabot/config/ProxyConfig;Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/String;IILjava/lang/Object;)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public final fun getHost ()Ljava/lang/String;
|
||||
public final fun getPort ()I
|
||||
public final fun getType ()Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public fun hashCode ()I
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/ProxyType : java/lang/Enum {
|
||||
public static final field HTTP Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field HTTPS Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field NO_PROXY Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field SOCKS4 Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static final field SOCKS5 Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static fun valueOf (Ljava/lang/String;)Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public static fun values ()[Lnet/lamgc/scalabot/config/ProxyType;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/UsernameAuthenticator : com/sun/net/httpserver/BasicAuthenticator {
|
||||
public fun <init> (Ljava/lang/String;Ljava/lang/String;)V
|
||||
public fun checkCredentials (Ljava/lang/String;Ljava/lang/String;)Z
|
||||
public fun equals (Ljava/lang/Object;)Z
|
||||
public fun hashCode ()I
|
||||
public final fun toJsonObject ()Lcom/google/gson/JsonObject;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ArtifactSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ArtifactSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lorg/eclipse/aether/artifact/Artifact;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lorg/eclipse/aether/artifact/Artifact;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/AuthenticationSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/AuthenticationSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lorg/eclipse/aether/repository/Authentication;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/BotAccountSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/BotAccountSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/BotAccount;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/BotConfigSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/BotConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/BotConfig;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/BotConfig;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/MavenRepositoryConfigSerializer : com/google/gson/JsonDeserializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/MavenRepositoryConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/MavenRepositoryConfig;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ProxyConfigSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ProxyConfigSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/ProxyConfig;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/ProxyConfig;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/ProxyTypeSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/ProxyTypeSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/ProxyType;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/ProxyType;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
||||
public final class net/lamgc/scalabot/config/serializer/UsernameAuthenticatorSerializer : com/google/gson/JsonDeserializer, com/google/gson/JsonSerializer {
|
||||
public static final field INSTANCE Lnet/lamgc/scalabot/config/serializer/UsernameAuthenticatorSerializer;
|
||||
public synthetic fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Ljava/lang/Object;
|
||||
public fun deserialize (Lcom/google/gson/JsonElement;Ljava/lang/reflect/Type;Lcom/google/gson/JsonDeserializationContext;)Lnet/lamgc/scalabot/config/UsernameAuthenticator;
|
||||
public synthetic fun serialize (Ljava/lang/Object;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
public fun serialize (Lnet/lamgc/scalabot/config/UsernameAuthenticator;Ljava/lang/reflect/Type;Lcom/google/gson/JsonSerializationContext;)Lcom/google/gson/JsonElement;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.kotlinx.kover")
|
||||
id("org.jetbrains.dokka") version "1.7.0"
|
||||
id("org.jetbrains.dokka") version "1.7.20"
|
||||
`maven-publish`
|
||||
signing
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.11.1"
|
||||
id("org.jetbrains.kotlinx.binary-compatibility-validator")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -12,20 +12,16 @@ dependencies {
|
||||
api("org.eclipse.aether:aether-api:$aetherVersion")
|
||||
implementation("org.eclipse.aether:aether-util:$aetherVersion")
|
||||
|
||||
implementation("org.telegram:telegrambots-meta:6.1.0")
|
||||
implementation("org.telegram:telegrambots-meta:6.5.0")
|
||||
|
||||
// Added as a mitigation measure for vulnerabilities.
|
||||
// When the relevant reference dependency updates it, it will be removed.
|
||||
implementation("com.fasterxml.jackson.core:jackson-databind:2.13.4.2")
|
||||
|
||||
api("com.google.code.gson:gson:2.9.0")
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
|
||||
testImplementation(kotlin("test"))
|
||||
testImplementation("io.mockk:mockk:1.12.7")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.0")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.0")
|
||||
testImplementation("io.mockk:mockk:1.13.2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
|
||||
|
||||
dokkaHtmlPlugin("org.jetbrains.dokka:javadoc-plugin:1.7.10")
|
||||
dokkaHtmlPlugin("org.jetbrains.dokka:javadoc-plugin:1.7.20")
|
||||
}
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||
|
Reference in New Issue
Block a user