mirror of
https://github.com/InsanusMokrassar/TelegramBotApiLibraries.git
synced 2026-06-18 17:24:57 +00:00
Compare commits
19 Commits
32bceb9012
...
renovate/g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7863da397e | ||
| 6f3488518b | |||
| cd4c893f7c | |||
| 2487d51606 | |||
| 6b28e89595 | |||
| 7729ada3bb | |||
| 58c4fe90b9 | |||
| 60cbe3bb70 | |||
| 63f15e96bf | |||
| 167f302eff | |||
| 8332ed482e | |||
| 061bac146c | |||
| 00fc2a1e0b | |||
| 1e2e45c404 | |||
| 17398781a5 | |||
| f86dbcefce | |||
| e4aba03cdc | |||
| c8f8608a60 | |||
| 19fcee9f3e |
10
CHANGELOG.md
Normal file
10
CHANGELOG.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.30.0
|
||||
|
||||
* `Kotlin`: `2.3.20`
|
||||
* `MicroUtils`: `0.29.2`
|
||||
* `Exposed`: `1.2.0`
|
||||
* `PlaguBot`: `11.2.0`
|
||||
* `TgBotAPI`: `33.1.0`
|
||||
* `Serialization`: `1.11.0`
|
||||
@@ -34,7 +34,7 @@ class DefaultAdminsCacheAPIRepoImpl(
|
||||
private val scope: CoroutineScope
|
||||
) : DefaultAdminsCacheAPIRepo {
|
||||
private val actor = scope.actorAsync<RepoActions<*>>(Channel.UNLIMITED) {
|
||||
safelyWithoutExceptions(
|
||||
runCatchingLogging (
|
||||
{ e ->
|
||||
it.deferred.completeExceptionally(e)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.modules.polymorphic
|
||||
import org.jetbrains.exposed.sql.Database
|
||||
import org.jetbrains.exposed.v1.jdbc.Database
|
||||
|
||||
val telegramAdminsSerializationFormat = Json {
|
||||
ignoreUnknownKeys = true
|
||||
|
||||
@@ -16,7 +16,7 @@ import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import org.jetbrains.exposed.sql.Database
|
||||
import org.jetbrains.exposed.v1.jdbc.Database
|
||||
import org.koin.core.Koin
|
||||
import org.koin.core.module.Module
|
||||
import org.koin.core.qualifier.named
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("RemoveExplicitTypeArguments", "unused")
|
||||
|
||||
package dev.inmo.tgbotapi.libraries.cache.media.micro_utils
|
||||
|
||||
import dev.inmo.micro_utils.repos.*
|
||||
@@ -8,7 +10,6 @@ import dev.inmo.tgbotapi.types.MessageId
|
||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.builtins.PairSerializer
|
||||
import kotlinx.serialization.builtins.serializer
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlin.js.JsName
|
||||
@@ -52,11 +53,12 @@ val chatIdToMessageIdentifierSerializer = PairSerializer(
|
||||
|
||||
val messageContentSerializer = PolymorphicSerializer<MessageContent>(MessageContent::class)
|
||||
|
||||
inline fun <K> KeyValueRepo<K, MessageContent>.asMessageContentCache() = SimpleKeyValueMessageContentCache(this)
|
||||
fun <K> KeyValueRepo<K, MessageContent>.asMessageContentCache() = SimpleKeyValueMessageContentCache(this)
|
||||
|
||||
inline fun KeyValueRepo<String, String>.asMessageContentCache(
|
||||
serialFormatCreator: (SerializersModule) -> StringFormat = { Json { serializersModule = it } }
|
||||
): StandardKeyValueRepo<Pair<ChatId, MessageId>, MessageContent> {
|
||||
@Suppress("OPT_IN_USAGE")
|
||||
val serialFormat = serialFormatCreator(MessageContent.serializationModule())
|
||||
return withMapper<Pair<ChatId, MessageId>, MessageContent, String, String>(
|
||||
{ serialFormat.encodeToString(chatIdToMessageIdentifierSerializer, this) },
|
||||
@@ -71,6 +73,7 @@ inline fun KeyValueRepo<String, String>.asMessageContentCache(
|
||||
inline fun KeyValueRepo<String, String>.asMessageContentCache(
|
||||
serialFormatCreator: (SerializersModule) -> BinaryFormat
|
||||
): StandardKeyValueRepo<Pair<ChatId, MessageId>, MessageContent> {
|
||||
@Suppress("OPT_IN_USAGE")
|
||||
val serialFormat = serialFormatCreator(MessageContent.serializationModule())
|
||||
return withMapper<Pair<ChatId, MessageId>, MessageContent, String, String>(
|
||||
{ serialFormat.encodeToHexString(chatIdToMessageIdentifierSerializer, this) },
|
||||
@@ -85,6 +88,7 @@ inline fun KeyValueRepo<String, String>.asMessageContentCache(
|
||||
inline fun KeyValueRepo<ByteArray, ByteArray>.asMessageContentCache(
|
||||
serialFormatCreator: (SerializersModule) -> BinaryFormat
|
||||
): StandardKeyValueRepo<Pair<ChatId, MessageId>, MessageContent> {
|
||||
@Suppress("OPT_IN_USAGE")
|
||||
val serialFormat = serialFormatCreator(MessageContent.serializationModule())
|
||||
return withMapper<Pair<ChatId, MessageId>, MessageContent, ByteArray, ByteArray>(
|
||||
{ serialFormat.encodeToByteArray(chatIdToMessageIdentifierSerializer, this) },
|
||||
|
||||
@@ -6,23 +6,23 @@ kotlin.incremental=true
|
||||
kotlin.incremental.js=true
|
||||
|
||||
|
||||
kotlin_version=2.1.20
|
||||
kotlin_serialisation_core_version=1.8.1
|
||||
kotlin_version=2.3.20
|
||||
kotlin_serialisation_core_version=1.11.0
|
||||
|
||||
github_release_plugin_version=2.5.2
|
||||
|
||||
tgbotapi_version=26.0.0
|
||||
micro_utils_version=0.25.8
|
||||
exposed_version=0.61.0
|
||||
plagubot_version=10.6.0
|
||||
tgbotapi_version=33.1.0
|
||||
micro_utils_version=0.29.2
|
||||
exposed_version=1.2.0
|
||||
plagubot_version=11.2.0
|
||||
|
||||
nmcp_version=0.2.1
|
||||
nmcp_version=1.4.4
|
||||
|
||||
# Dokka
|
||||
|
||||
dokka_version=2.0.0
|
||||
dokka_version=2.2.0
|
||||
|
||||
# Project data
|
||||
|
||||
group=dev.inmo
|
||||
version=0.26.6
|
||||
version=0.30.0
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
7
gradlew
vendored
7
gradlew
vendored
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -172,7 +171,6 @@ fi
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
|
||||
32
gradlew.bat
vendored
32
gradlew.bat
vendored
@@ -23,8 +23,8 @@
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,30 +65,18 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
|
||||
Reference in New Issue
Block a user