diff --git a/.changelog/v0.0.11.md b/.changelog/v0.0.11.md new file mode 100644 index 0000000..3dc8f4b --- /dev/null +++ b/.changelog/v0.0.11.md @@ -0,0 +1,7 @@ +> 对应核心版本: [**v4.6.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.6.0) + + +我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-telegram/issues)或[协助](https://github.com/simple-robot/simbot-component-telegram/pulls), +感谢您的贡献与支持! + +也欢迎您为我们献上一颗 `star`,这是对我们最大的鼓励与认可! diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ea7718b..11ec986 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,3 +7,6 @@ updates: interval: weekly labels: - dependencies + assignees: + - ForteScarlet + open-pull-requests-limit: 10 diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 97a4879..c6a481c 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -17,6 +17,8 @@ on: - 'settings.gradle.kts' - 'gradle.properties' + tags-ignore: + - v** # 手动触发工作流 workflow_dispatch: diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index 608c503..c89013a 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -11,12 +11,22 @@ on: jobs: qodana: + if: ${{ !startsWith(github.head_ref, 'dependabot/') }} runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + checks: write steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' - uses: JetBrains/qodana-action@v2023.3.2 + uses: JetBrains/qodana-action@main + with: + upload-result: true + github-token: ${{ secrets.FORLIY_ACCESS_TOKEN }} env: - QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} # read the steps about it below + GITHUB_TOKEN: ${{ secrets.FORLIY_ACCESS_TOKEN }} diff --git a/buildSrc/src/main/kotlin/P.kt b/buildSrc/src/main/kotlin/P.kt index 544ea8b..76d39e2 100644 --- a/buildSrc/src/main/kotlin/P.kt +++ b/buildSrc/src/main/kotlin/P.kt @@ -40,8 +40,8 @@ object P { override val description: String get() = DESCRIPTION override val homepage: String get() = HOMEPAGE - const val VERSION = "0.0.10" - const val NEXT_VERSION = "0.0.11" + const val VERSION = "0.0.11" + const val NEXT_VERSION = "0.0.12" override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT" override val version = if (isSnapshot()) snapshotVersion else VERSION diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 12cb0fb..b11a98c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,26 +1,26 @@ [versions] -kotlin = "2.0.0" +kotlin = "2.0.10" kotlinx-coroutines = "1.8.1" -kotlinx-serialization = "1.6.3" +kotlinx-serialization = "1.7.1" kotlinx-datetime = "0.6.0" dokka = "1.9.20" okio = "3.3.0" -ktor = "2.3.11" -openjdk-jmh = "1.35" -log4j = "2.20.0" +ktor = "2.3.12" +openjdk-jmh = "1.37" +log4j = "2.23.1" reactor = "3.6.2" # simbot -simbot = "4.3.0" +simbot = "4.6.0" suspendTransform = "0.9.0" gradleCommon = "0.6.0" # ksp -ksp = "2.0.0-1.0.22" +ksp = "2.0.10-1.0.24" # https://square.github.io/kotlinpoet/ -kotlinPoet = "1.17.0" +kotlinPoet = "1.18.1" # https://mockk.io/ -mockk = "1.13.10" +mockk = "1.13.12" # https://detekt.dev/docs/intro -detekt = "1.23.3" +detekt = "1.23.6" [libraries] # simbot @@ -39,7 +39,7 @@ simbot-common-ktor-inputfile = { group = "love.forte.simbot.common", name = "sim simbot-gradle = { group = "love.forte.simbot.gradle", name = "simbot-gradle-suspendtransforms", version.ref = "simbot" } # jetbrains-annotation -jetbrains-annotations = "org.jetbrains:annotations:24.0.1" +jetbrains-annotations = "org.jetbrains:annotations:24.1.0" # kotlinx-coroutines kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } @@ -61,7 +61,6 @@ kotlinx-serialization-hocon = { group = "org.jetbrains.kotlinx", name = "kotlinx kotlinx-serialization-protobuf = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-protobuf", version.ref = "kotlinx-serialization" } kotlinx-serialization-cbor = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-cbor", version.ref = "kotlinx-serialization" } kotlinx-serialization-properties = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-properties", version.ref = "kotlinx-serialization" } -charleskorn-kaml = "com.charleskorn.kaml:kaml:0.49.0" # kotlinx-datetime kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" } diff --git a/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt b/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt index 1f6ad6f..43e595c 100644 --- a/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt +++ b/simbot-component-telegram-core/src/commonMain/kotlin/love/forte/simbot/component/telegram/core/bot/internal/TelegramBotManagerImpl.kt @@ -59,6 +59,11 @@ internal class TelegramBotManagerImpl( override fun register(ticket: Bot.Ticket, configuration: TelegramBotConfiguration): TelegramBot { val token = ticket.token + @Suppress("ControlFlowWithEmptyBody") + if (token.startsWith("bot")) { + // TODO 不需要手动写 `bot`, 如果写了,移除它,并有一个警告 + } + fun createBot(): TelegramBotImpl { val context = configuration.coroutineContext.mergeWith(coroutineContext) val job = context[Job]!! diff --git a/simbot-component-telegram-type/build.gradle.kts b/simbot-component-telegram-type/build.gradle.kts index a937f52..d303b6c 100644 --- a/simbot-component-telegram-type/build.gradle.kts +++ b/simbot-component-telegram-type/build.gradle.kts @@ -67,7 +67,7 @@ kotlin { jvmTest.dependencies { // for gen // https://jsoup.org/download - implementation("org.jsoup:jsoup:1.17.2") + implementation("org.jsoup:jsoup:1.18.1") // poet // https://square.github.io/kotlinpoet/ implementation(libs.kotlinPoet)