basically separated morny-coeur and morny-system-lib project

This commit is contained in:
A.C.Sukazyo Eyre 2024-07-12 17:25:12 +08:00
parent 388351593a
commit e6b5fa5157
Signed by: Eyre_S
GPG Key ID: C17CE40291207874
225 changed files with 415 additions and 341 deletions

View File

@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Morny CLI [pr]" type="Application" factoryName="Application"> <configuration default="false" name="Morny CLI [pr]" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.MornyCLI" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.MornyCLI" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />
<extension name="coverage"> <extension name="coverage">
<pattern> <pattern>

View File

@ -4,7 +4,7 @@
<option value="$PROJECT_DIR$/.run/debug.env" /> <option value="$PROJECT_DIR$/.run/debug.env" />
</option> </option>
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="PROGRAM_PARAMETERS" value="--quiet --debug -t --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --auto-cmd --outdated-ignore --trusted-reader-dinner 1040613596 --report-to 793274677 -medc 793274677 -medt 0,2,18,19 -medtz 8 --dinner-chat -1001670950261" /> <option name="PROGRAM_PARAMETERS" value="--quiet --debug -t --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --auto-cmd --outdated-ignore --trusted-reader-dinner 1040613596 --report-to 793274677 -medc 793274677 -medt 0,2,18,19 -medtz 8 --dinner-chat -1001670950261" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />
<extension name="coverage"> <extension name="coverage">

View File

@ -4,7 +4,7 @@
<option value="$PROJECT_DIR$/.run/debug.env" /> <option value="$PROJECT_DIR$/.run/debug.env" />
</option> </option>
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="PROGRAM_PARAMETERS" value="--quiet --debug --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --outdated-ignore --trusted-reader-dinner 1040613596 -medc 793274677 -medtz 8 --dinner-chat -1001670950261" /> <option name="PROGRAM_PARAMETERS" value="--quiet --debug --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --outdated-ignore --trusted-reader-dinner 1040613596 -medc 793274677 -medtz 8 --dinner-chat -1001670950261" />
<option name="VM_PARAMETERS" value="-Djava.net.useSystemProxies=true" /> <option name="VM_PARAMETERS" value="-Djava.net.useSystemProxies=true" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />

View File

@ -4,7 +4,7 @@
<option value="$PROJECT_DIR$/.run/debug.env" /> <option value="$PROJECT_DIR$/.run/debug.env" />
</option> </option>
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="PROGRAM_PARAMETERS" value="--quiet --debug --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --auto-cmd --outdated-ignore --trusted-reader-dinner 1040613596 --report-to 793274677 -medc 793274677 -medt 0,2,18,19 -medtz 8 --dinner-chat -1001670950261" /> <option name="PROGRAM_PARAMETERS" value="--quiet --debug --username sukazyo_deving_bot --master 793274677 --trusted-chat -1 --auto-cmd --outdated-ignore --trusted-reader-dinner 1040613596 --report-to 793274677 -medc 793274677 -medt 0,2,18,19 -medtz 8 --dinner-chat -1001670950261" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />
<extension name="coverage"> <extension name="coverage">

View File

@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="ServerMain [only-hello]" type="Application" factoryName="Application"> <configuration default="false" name="ServerMain [only-hello]" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="PROGRAM_PARAMETERS" value="--only-hello" /> <option name="PROGRAM_PARAMETERS" value="--only-hello" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />
<extension name="coverage"> <extension name="coverage">

View File

@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="ServerMain [version]" type="Application" factoryName="Application"> <configuration default="false" name="ServerMain [version]" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" /> <option name="MAIN_CLASS_NAME" value="cc.sukazyo.cono.morny.core.ServerMain" />
<module name="Coeur Morny Cono" /> <module name="root.Coeur Morny Cono" />
<option name="PROGRAM_PARAMETERS" value="--version" /> <option name="PROGRAM_PARAMETERS" value="--version" />
<option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" /> <option name="WORKING_DIRECTORY" value="$ProjectFileDir$/run" />
<extension name="coverage"> <extension name="coverage">

111
build.sbt
View File

@ -1,37 +1,79 @@
aether.AetherKeys.aetherOldVersionMethod := true aether.AetherKeys.aetherOldVersionMethod := true
ThisBuild / organization := "cc.sukazyo" ThisBuild / organization := MornyProject.group
ThisBuild / organizationName := "A.C. Sukazyo Eyre" ThisBuild / organizationName := MornyProject.group_name
ThisBuild / version := MornyProject.version
ThisBuild / scalaVersion := "3.4.1" ThisBuild / scalaVersion := "3.4.1"
resolvers ++= Seq( ThisBuild / resolvers ++= Seq(
"-ws-releases" at "https://mvn.sukazyo.cc/releases" "-ws-releases" at "https://mvn.sukazyo.cc/releases"
) )
lazy val root = (project in file(".")) ThisBuild / crossPaths := false
.enablePlugins(BuildInfoPlugin)
.settings(
name := "Coeur Morny Cono", ThisBuild / Compile / packageDoc / publishArtifact := false
version := MornyProject.version, artifactName := {(sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
crossPaths := false,
moduleName := MornyProject.app_archive_name,
Compile / packageDoc / publishArtifact := false,
artifactName := {(sv: ScalaVersion, module: ModuleID, artifact: Artifact) =>
val classifier = artifact.classifier match { val classifier = artifact.classifier match {
case Some(value) => s"-$value" case Some(value) => s"-$value"
case None => "" case None => ""
} }
s"${module.name}-${MornyProject.version_full}$classifier.${artifact.extension}" s"${module.name}-${module.revision}$classifier.${artifact.extension}"
}, }
Compile / mainClass := Some(MornyProject.app_application_main), ThisBuild / scalacOptions ++= Seq(
"-language:postfixOps",
"-encoding", MornyProject.source_encoding
)
ThisBuild / javacOptions ++= Seq(
"-encoding", MornyProject.source_encoding,
"-source", "17",
"-target", "17"
)
ThisBuild / autoAPIMappings := true
ThisBuild / apiMappings ++= {
def mappingsFor(organization: String, names: List[String], location: String, revision: String => String = identity): Seq[(File, URL)] =
for {
entry: Attributed[File] <- (Compile / fullClasspath).value
module: ModuleID <- entry.get(moduleID.key)
if module.organization == organization
if names.exists(module.name.startsWith)
} yield entry.data -> url(location.format(revision(module.revision)))
val mappings: Seq[(File, URL)] = Seq(
mappingsFor("org.scala-lang", List("scala-library"), "https://scala-lang.org/api/%s/"),
mappingsFor("com.github.pengrad", "java-telegram-bot-api"::Nil, "https://jitpack.io/com/github/pengrad/java-telegram-bot-api/6.3.0/javadoc/"),
).flatten
mappings.toMap
}
libraryDependencies ++= MornyProject.dependencies, ThisBuild / publishTo := MornyProject.publishTo
ThisBuild / credentials ++= MornyProject.publishCredentials
buildInfoPackage := MornyProject.app_package, lazy val morny_system_lib = (project in file (MornyProject.morny_system_lib.id))
.enablePlugins(BuildInfoPlugin)
.settings(
name := MornyProject.morny_system_lib.name,
moduleName := MornyProject.morny_system_lib.id,
libraryDependencies ++= MornyProject.morny_system_lib.dependencies,
)
lazy val morny_coeur = (project in file(MornyProject.morny_coeur.id))
.enablePlugins(BuildInfoPlugin)
.dependsOn(morny_system_lib)
.settings(
name := MornyProject.morny_coeur.name,
moduleName := MornyProject.morny_coeur.id,
Compile / mainClass := Some(MornyProject.morny_coeur.main_class),
libraryDependencies ++= MornyProject.morny_coeur.dependencies,
buildInfoPackage := MornyProject.morny_coeur.root_package,
buildInfoObject := "BuildConfig", buildInfoObject := "BuildConfig",
buildInfoKeys ++= Seq( buildInfoKeys ++= Seq(
BuildInfoKey[String]("VERSION", MornyProject.version), BuildInfoKey[String]("VERSION", MornyProject.version),
@ -46,31 +88,6 @@ lazy val root = (project in file("."))
BuildInfoKey[String]("COMMIT_PATH", MornyProject.git_store_path), BuildInfoKey[String]("COMMIT_PATH", MornyProject.git_store_path),
), ),
scalacOptions ++= Seq(
"-language:postfixOps",
"-encoding", MornyProject.source_encoding
),
javacOptions ++= Seq(
"-encoding", MornyProject.source_encoding,
"-source", "17",
"-target", "17"
),
autoAPIMappings := true,
apiMappings ++= {
def mappingsFor(organization: String, names: List[String], location: String, revision: String => String = identity): Seq[(File, URL)] =
for {
entry: Attributed[File] <- (Compile / fullClasspath).value
module: ModuleID <- entry.get(moduleID.key)
if module.organization == organization
if names.exists(module.name.startsWith)
} yield entry.data -> url(location.format(revision(module.revision)))
val mappings: Seq[(File, URL)] = Seq(
mappingsFor("org.scala-lang", List("scala-library"), "https://scala-lang.org/api/%s/"),
mappingsFor("com.github.pengrad", "java-telegram-bot-api"::Nil, "https://jitpack.io/com/github/pengrad/java-telegram-bot-api/6.3.0/javadoc/"),
).flatten
mappings.toMap
},
assemblyMergeStrategy := { assemblyMergeStrategy := {
case module if module endsWith "module-info.class" => MergeStrategy.concat case module if module endsWith "module-info.class" => MergeStrategy.concat
case module_kt if module_kt endsWith ".kotlin_module" => MergeStrategy.concat case module_kt if module_kt endsWith ".kotlin_module" => MergeStrategy.concat
@ -88,11 +105,11 @@ lazy val root = (project in file("."))
assembly / assemblyJarName := { assembly / assemblyJarName := {
sLog.value info "environment DOCKER_BUILD checked" sLog.value info "environment DOCKER_BUILD checked"
sLog.value info "assembly will output for docker build (morny-coeur-docker-build.jar)" sLog.value info "assembly will output for docker build (morny-coeur-docker-build.jar)"
"morny-coeur-docker-build.jar" s"${MornyProject.morny_coeur.id}-docker-build.jar"
} }
} else Nil, } else Nil,
publishTo := MornyProject.publishTo,
credentials ++= MornyProject.publishCredentials,
) )
lazy val root = (project in file ("."))
.aggregate(morny_system_lib, morny_coeur)

3
morny-coeur/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# builds
/target

View File

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

@ -1,10 +1,10 @@
package cc.sukazyo.cono.morny.call_me package cc.sukazyo.cono.morny.call_me
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.model.{Chat, Message, User} import com.pengrad.telegrambot.model.{Chat, Message, User}
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.{ForwardMessage, GetChat, SendMessage, SendSticker} import com.pengrad.telegrambot.request.{ForwardMessage, GetChat, SendMessage, SendSticker}
@ -75,9 +75,9 @@ class OnCallMe (using coeur: MornyCoeur) extends EventListener {
lastDinnerData.forwardFromChat.id, lastDinnerData.forwardFromChat.id,
lastDinnerData.forwardFromMessageId lastDinnerData.forwardFromMessageId
).unsafeExecute ).unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.system.utils.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.util.CommonFormat.{formatDate, formatDuration} import cc.sukazyo.cono.morny.util.CommonFormat.{formatDate, formatDuration}
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h
def lastDinner_dateMillis: EpochMillis = EpochMillis fromSeconds lastDinnerData.forwardDate def lastDinner_dateMillis: EpochMillis = EpochMillis fromSeconds lastDinnerData.forwardDate
SendMessage( SendMessage(
req.from.id, req.from.id,

View File

@ -1,9 +1,9 @@
package cc.sukazyo.cono.morny.call_me package cc.sukazyo.cono.morny.call_me
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.* import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.*
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.model.{Chat, Message, MessageEntity} import com.pengrad.telegrambot.model.{Chat, Message, MessageEntity}
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.{GetChat, SendMessage, SendSticker} import com.pengrad.telegrambot.request.{GetChat, SendMessage, SendSticker}
@ -115,8 +115,8 @@ class OnCallMsgSend (using coeur: MornyCoeur) extends EventListener {
val targetChatResponse = GetChat(messageToSend.targetId).execute val targetChatResponse = GetChat(messageToSend.targetId).execute
if (targetChatResponse isOk) { if (targetChatResponse isOk) {
def getChatDescriptionHTML (chat: Chat): String = def getChatDescriptionHTML (chat: Chat): String =
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
// language=html // language=html
s"""<i><u>${h(chat.id toString)}</u>@${h(chat.`type`.name)}</i>${if (chat.`type` != Chat.Type.Private) ":::" else ""} s"""<i><u>${h(chat.id toString)}</u>@${h(chat.`type`.name)}</i>${if (chat.`type` != Chat.Type.Private) ":::" else ""}
|${chat.typeTag} <b>${h(chat.safe_name)}</b> ${chat.safe_linkHTML}""" |${chat.typeTag} <b>${h(chat.safe_name)}</b> ${chat.safe_linkHTML}"""

View File

@ -10,10 +10,10 @@ import cc.sukazyo.cono.morny.core.http.api.{HttpServer, MornyHttpServerContext}
import cc.sukazyo.cono.morny.core.http.internal.MornyHttpServerContextImpl import cc.sukazyo.cono.morny.core.http.internal.MornyHttpServerContextImpl
import cc.sukazyo.cono.morny.core.module.ModuleHelper import cc.sukazyo.cono.morny.core.module.ModuleHelper
import cc.sukazyo.cono.morny.reporter.MornyReport import cc.sukazyo.cono.morny.reporter.MornyReport
import cc.sukazyo.cono.morny.system.utils.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.system.utils.GivenContext
import cc.sukazyo.cono.morny.util.schedule.Scheduler import cc.sukazyo.cono.morny.util.schedule.Scheduler
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.util.time.WatchDog import cc.sukazyo.cono.morny.util.time.WatchDog
import cc.sukazyo.cono.morny.util.GivenContext
import cc.sukazyo.cono.morny.util.UseString.MString import cc.sukazyo.cono.morny.util.UseString.MString
import cc.sukazyo.cono.morny.util.UseThrowable.toLogString import cc.sukazyo.cono.morny.util.UseThrowable.toLogString
import cc.sukazyo.cono.morny.util.dataview.Table import cc.sukazyo.cono.morny.util.dataview.Table
@ -358,7 +358,7 @@ class MornyCoeur (modules: List[MornyModule])(using val config: MornyConfig)(tes
* translations.trans(/* ... */) * translations.trans(/* ... */)
* // or use as an implicit/using value * // or use as an implicit/using value
* import com.pengrad.telegrambot.request.SendMessage * import com.pengrad.telegrambot.request.SendMessage
* import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute * import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
* SendMessage(/* ... */) * SendMessage(/* ... */)
* .unsafeExecute // implicitly use coeur.account * .unsafeExecute // implicitly use coeur.account
* *
@ -458,7 +458,7 @@ class MornyCoeur (modules: List[MornyModule])(using val config: MornyConfig)(tes
for (i <- 0 to 3) { for (i <- 0 to 3) {
if i > 0 then logger `info` "retrying..." if i > 0 then logger `info` "retrying..."
try { try {
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.execute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.execute
val remote = GetMe().execute(using account).user val remote = GetMe().execute(using account).user
if ((config.telegramBotUsername ne null) && config.telegramBotUsername != remote.username) if ((config.telegramBotUsername ne null) && config.telegramBotUsername != remote.username)
throw RuntimeException(s"Required the bot @${config.telegramBotUsername} but @${remote.username} logged in") throw RuntimeException(s"Required the bot @${config.telegramBotUsername} but @${remote.username} logged in")

View File

@ -2,7 +2,7 @@ package cc.sukazyo.cono.morny.core
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.internal.BuildConfigField import cc.sukazyo.cono.morny.core.internal.BuildConfigField
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochMillis import cc.sukazyo.cono.morny.system.utils.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.util.FileUtils import cc.sukazyo.cono.morny.util.FileUtils
import cc.sukazyo.cono.morny.BuildConfig import cc.sukazyo.cono.morny.BuildConfig
import cc.sukazyo.cono.morny.util.UseThrowable.toLogString import cc.sukazyo.cono.morny.util.UseThrowable.toLogString

View File

@ -1,8 +1,8 @@
package cc.sukazyo.cono.morny.core package cc.sukazyo.cono.morny.core
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.{LimboChat, LimboUser} import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.{LimboChat, LimboUser}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Chat.* import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Chat.*
import com.pengrad.telegrambot.model.ChatMember.Status import com.pengrad.telegrambot.model.ChatMember.Status
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot
import com.pengrad.telegrambot.model.User import com.pengrad.telegrambot.model.User

View File

@ -3,7 +3,7 @@ package cc.sukazyo.cono.morny.core.bot.api
import cc.sukazyo.cono.morny.core.{Log, MornyCoeur} import cc.sukazyo.cono.morny.core.{Log, MornyCoeur}
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.reporter.MornyReport import cc.sukazyo.cono.morny.reporter.MornyReport
import cc.sukazyo.cono.morny.util.tgapi.event.EventRuntimeException import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener, EventRuntimeException}
import cc.sukazyo.cono.morny.util.UseThrowable.toLogString import cc.sukazyo.cono.morny.util.UseThrowable.toLogString
import com.google.gson.GsonBuilder import com.google.gson.GsonBuilder
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update

View File

@ -3,8 +3,8 @@ package cc.sukazyo.cono.morny.core.bot.api
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{InputCommand, ISimpleCommand, ITelegramCommand}
import com.pengrad.telegrambot.model.{BotCommand, DeleteMyCommands, Update} import com.pengrad.telegrambot.model.{BotCommand, DeleteMyCommands, Update}
import com.pengrad.telegrambot.request.{SendSticker, SetMyCommands} import com.pengrad.telegrambot.request.{SendSticker, SetMyCommands}
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -1,6 +1,7 @@
package cc.sukazyo.cono.morny.core.bot.api package cc.sukazyo.cono.morny.core.bot.api
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.system.telegram_api.inline_query.{InlineQueryUnit, ITelegramQuery}
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import scala.collection.mutable import scala.collection.mutable

View File

@ -1,6 +1,7 @@
package cc.sukazyo.cono.morny.core.bot.api package cc.sukazyo.cono.morny.core.bot.api
import cc.sukazyo.cono.morny.core.bot.api.MornyCommandManager.CommandMap import cc.sukazyo.cono.morny.core.bot.api.MornyCommandManager.CommandMap
import cc.sukazyo.cono.morny.system.telegram_api.command.ISimpleCommand
import scala.collection.mutable import scala.collection.mutable

View File

@ -1,8 +1,8 @@
package cc.sukazyo.cono.morny.core.bot.api.messages package cc.sukazyo.cono.morny.core.bot.api.messages
import cc.sukazyo.cono.morny.core.bot.api.messages.MessageThread.{CallbackParameterized, ThreadKey} import cc.sukazyo.cono.morny.core.bot.api.messages.MessageThread.{CallbackParameterized, ThreadKey}
import cc.sukazyo.cono.morny.util.tgapi.Standardize.{ChatID, UserID} import cc.sukazyo.cono.morny.system.telegram_api.Standardize.{ChatID, UserID}
import cc.sukazyo.cono.morny.util.EpochDateTime.DurationMillis import cc.sukazyo.cono.morny.system.utils.EpochDateTime.DurationMillis
import com.pengrad.telegrambot.model.Message import com.pengrad.telegrambot.model.Message
trait MessageThread [P] { trait MessageThread [P] {

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.core.bot.api.messages package cc.sukazyo.cono.morny.core.bot.api.messages
import cc.sukazyo.cono.morny.util.tgapi.Standardize.* import cc.sukazyo.cono.morny.system.telegram_api.Standardize.*
import com.pengrad.telegrambot.model.{Chat, Message, User} import com.pengrad.telegrambot.model.{Chat, Message, User}
/** /**

View File

@ -2,10 +2,9 @@ package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import com.pengrad.telegrambot.model.{Chat, Update} import com.pengrad.telegrambot.model.{Chat, Update}
import com.pengrad.telegrambot.request.{DeleteMessage, GetChatMember, SendSticker} import com.pengrad.telegrambot.request.{DeleteMessage, GetChatMember, SendSticker}
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -1,13 +1,13 @@
package cc.sukazyo.cono.morny.core.bot.command package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener, ICommandAlias, ITelegramCommand}
import cc.sukazyo.cono.morny.core.bot.api.ICommandAlias.ListedAlias
import cc.sukazyo.cono.morny.core.bot.api.messages.MessagingContext import cc.sukazyo.cono.morny.core.bot.api.messages.MessagingContext
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.ICommandAlias.ListedAlias
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Chat.notOfType import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Chat.notOfType
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.model.{Chat, Update} import com.pengrad.telegrambot.model.{Chat, Update}
import com.pengrad.telegrambot.request.SendSticker import com.pengrad.telegrambot.request.SendSticker
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -1,10 +1,9 @@
package cc.sukazyo.cono.morny.core.bot.command package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.data.MornyInformation.{getAboutPic, getMornyAboutLinksVars} import cc.sukazyo.cono.morny.data.MornyInformation.{getAboutPic, getMornyAboutLinksVars}
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.SendPhoto import com.pengrad.telegrambot.request.SendPhoto

View File

@ -1,15 +1,14 @@
package cc.sukazyo.cono.morny.core.bot.command package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.{MornyCoeur, MornySystem} import cc.sukazyo.cono.morny.core.{MornyCoeur, MornySystem}
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ITelegramCommand}
import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext} import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext}
import cc.sukazyo.cono.morny.data.MornyInformation.* import cc.sukazyo.cono.morny.data.MornyInformation.*
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.reporter.MornyReport import cc.sukazyo.cono.morny.reporter.MornyReport
import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import cc.sukazyo.cono.morny.util.CommonFormat.{formatDate, formatDuration} import cc.sukazyo.cono.morny.util.CommonFormat.{formatDate, formatDuration}
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.var_text import cc.sukazyo.cono.morny.util.var_text
import cc.sukazyo.cono.morny.util.var_text.VarText import cc.sukazyo.cono.morny.util.var_text.VarText
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update

View File

@ -1,7 +1,6 @@
package cc.sukazyo.cono.morny.core.bot.command package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand} import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
class MornyInformationOlds (using base: MornyInformation) { class MornyInformationOlds (using base: MornyInformation) {

View File

@ -1,15 +1,15 @@
package cc.sukazyo.cono.morny.core.bot.command package cc.sukazyo.cono.morny.core.bot.command
import cc.sukazyo.cono.morny.core.bot.api.ICommandAlias.HiddenAlias
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{messages, ICommandAlias, ISimpleCommand, ITelegramCommand} import cc.sukazyo.cono.morny.core.bot.api.messages
import cc.sukazyo.cono.morny.core.bot.api.messages.MessagingContext import cc.sukazyo.cono.morny.core.bot.api.messages.MessagingContext
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.reporter.MornyReport import cc.sukazyo.cono.morny.reporter.MornyReport
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.ICommandAlias.HiddenAlias
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand, ITelegramCommand}
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.request.{EditMessageText, SendMessage, SendSticker} import com.pengrad.telegrambot.request.{EditMessageText, SendMessage, SendSticker}

View File

@ -1,8 +1,10 @@
package cc.sukazyo.cono.morny.core.bot.event package cc.sukazyo.cono.morny.core.bot.event
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener, InlineQueryUnit, MornyQueryManager} import cc.sukazyo.cono.morny.core.bot.api.MornyQueryManager
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.system.telegram_api.inline_query.InlineQueryUnit
import com.pengrad.telegrambot.model.request.InlineQueryResult import com.pengrad.telegrambot.model.request.InlineQueryResult
import com.pengrad.telegrambot.request.AnswerInlineQuery import com.pengrad.telegrambot.request.AnswerInlineQuery
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -2,8 +2,9 @@ package cc.sukazyo.cono.morny.core.bot.event
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener, MornyCommandManager} import cc.sukazyo.cono.morny.core.bot.api.MornyCommandManager
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.InputCommand
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.model.{Message, Update} import com.pengrad.telegrambot.model.{Message, Update}
class MornyOnTelegramCommand (using commandManager: MornyCommandManager) (using coeur: MornyCoeur) extends EventListener { class MornyOnTelegramCommand (using commandManager: MornyCommandManager) (using coeur: MornyCoeur) extends EventListener {

View File

@ -1,9 +1,9 @@
package cc.sukazyo.cono.morny.core.bot.event package cc.sukazyo.cono.morny.core.bot.event
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener} import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Update.sourceTime
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Update.sourceTime import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochMillis import cc.sukazyo.cono.morny.system.utils.EpochDateTime.EpochMillis
class MornyOnUpdateTimestampOffsetLock (using coeur: MornyCoeur) extends EventListener { class MornyOnUpdateTimestampOffsetLock (using coeur: MornyCoeur) extends EventListener {

View File

@ -1,12 +1,11 @@
package cc.sukazyo.cono.morny.core.bot.internal package cc.sukazyo.cono.morny.core.bot.internal
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext} import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext}
import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import cc.sukazyo.cono.morny.system.utils.EpochDateTime.DurationMillis
import cc.sukazyo.cono.morny.util.schedule.{DelayedTask, Scheduler} import cc.sukazyo.cono.morny.util.schedule.{DelayedTask, Scheduler}
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.EpochDateTime.DurationMillis
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.request.{AbstractSendRequest, SendMessage} import com.pengrad.telegrambot.request.{AbstractSendRequest, SendMessage}

View File

@ -1,11 +1,11 @@
package cc.sukazyo.cono.morny.core.bot.internal package cc.sukazyo.cono.morny.core.bot.internal
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener, ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.core.bot.api.messages.{MessageThread, MessagingContext, ThreadingManager} import cc.sukazyo.cono.morny.core.bot.api.messages.{MessageThread, MessagingContext, ThreadingManager}
import cc.sukazyo.cono.morny.core.bot.api.messages.MessageThread.{Callback, CallbackParameterized, ThreadKey} import cc.sukazyo.cono.morny.core.bot.api.messages.MessageThread.{Callback, CallbackParameterized, ThreadKey}
import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.util.schedule.{DelayedTask, Scheduler, Task} import cc.sukazyo.cono.morny.util.schedule.{DelayedTask, Scheduler, Task}
import cc.sukazyo.cono.morny.util.tgapi.InputCommand
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import com.pengrad.telegrambot.model.{Message, Update} import com.pengrad.telegrambot.model.{Message, Update}
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage

View File

@ -1,11 +1,10 @@
package cc.sukazyo.cono.morny.crons.cmd package cc.sukazyo.cono.morny.crons.cmd
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext} import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import cc.sukazyo.cono.morny.util.UseThrowable.toLogString import cc.sukazyo.cono.morny.util.UseThrowable.toLogString
import com.cronutils.descriptor.CronDescriptor import com.cronutils.descriptor.CronDescriptor
import com.cronutils.model.{Cron, CronType} import com.cronutils.model.{Cron, CronType}

View File

@ -2,16 +2,15 @@ package cc.sukazyo.cono.morny.encrypt_tool
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ITelegramCommand}
import cc.sukazyo.cono.morny.core.bot.api.ICommandAlias.ListedAlias
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.reporter.MornyReport import cc.sukazyo.cono.morny.reporter.MornyReport
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.ICommandAlias.ListedAlias
import cc.sukazyo.cono.morny.util.CommonEncrypt import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.File.getContent
import cc.sukazyo.cono.morny.util.CommonEncrypt.* import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.ConvertByteHex.toHex import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.File.getContent import cc.sukazyo.cono.morny.system.utils.CommonEncrypt
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.utils.CommonEncrypt.*
import cc.sukazyo.cono.morny.system.utils.ConvertByteHex.toHex
import com.pengrad.telegrambot.model.{PhotoSize, Update} import com.pengrad.telegrambot.model.{PhotoSize, Update}
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.{GetFile, SendDocument, SendMessage, SendSticker} import com.pengrad.telegrambot.request.{GetFile, SendDocument, SendMessage, SendSticker}
@ -203,7 +202,7 @@ class Encryptor (using coeur: MornyCoeur) extends ITelegramCommand {
).fileName(_file.resultName).replyToMessageId(event.message.messageId) ).fileName(_file.resultName).replyToMessageId(event.message.messageId)
.unsafeExecute .unsafeExecute
case _text: EXTextLike => case _text: EXTextLike =>
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
SendMessage( SendMessage(
event.message.chat.id, event.message.chat.id,
// language=html // language=html

View File

@ -1,9 +1,8 @@
package cc.sukazyo.cono.morny.ip186 package cc.sukazyo.cono.morny.ip186
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ITelegramCommand} import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage
@ -54,7 +53,7 @@ class BotCommand (using coeur: MornyCoeur) {
return; return;
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
try { try {
val response = command.command match val response = command.command match

View File

@ -3,10 +3,10 @@ package cc.sukazyo.cono.morny.medication_timer
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.medication_timer.MedicationTimer.calcNextRoutineTimestamp import cc.sukazyo.cono.morny.medication_timer.MedicationTimer.calcNextRoutineTimestamp
import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.utils.EpochDateTime.EpochMillis
import cc.sukazyo.cono.morny.util.schedule.RoutineTask import cc.sukazyo.cono.morny.util.schedule.RoutineTask
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.CommonFormat import cc.sukazyo.cono.morny.util.CommonFormat
import cc.sukazyo.cono.morny.util.EpochDateTime.EpochMillis
import com.cronutils.builder.CronBuilder import com.cronutils.builder.CronBuilder
import com.cronutils.model.definition.{CronDefinition, CronDefinitionBuilder} import com.cronutils.model.definition.{CronDefinition, CronDefinitionBuilder}
import com.cronutils.model.time.ExecutionTime import com.cronutils.model.time.ExecutionTime

View File

@ -1,7 +1,7 @@
package cc.sukazyo.cono.morny.medication_timer package cc.sukazyo.cono.morny.medication_timer
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener} import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.model.Message import com.pengrad.telegrambot.model.Message
class OnMedicationNotifyApply (using instance: MedicationTimer)(using coeur: MornyCoeur) extends EventListener { class OnMedicationNotifyApply (using instance: MedicationTimer)(using coeur: MornyCoeur) extends EventListener {

View File

@ -1,6 +1,6 @@
package cc.sukazyo.cono.morny.morny_misc package cc.sukazyo.cono.morny.morny_misc
import cc.sukazyo.cono.morny.util.EpochDateTime.{EpochDays, EpochMillis} import cc.sukazyo.cono.morny.system.utils.EpochDateTime.{EpochDays, EpochMillis}
import com.pengrad.telegrambot.model.User import com.pengrad.telegrambot.model.User
import scala.language.postfixOps import scala.language.postfixOps
@ -11,8 +11,8 @@ object MornyJrrp {
jrrp_v_xmomi(user.id, EpochDays fromMillis timestamp) * 100.0 jrrp_v_xmomi(user.id, EpochDays fromMillis timestamp) * 100.0
private def jrrp_v_xmomi (identifier: Long, dayStamp: EpochDays): Double = private def jrrp_v_xmomi (identifier: Long, dayStamp: EpochDays): Double =
import cc.sukazyo.cono.morny.util.CommonEncrypt.MD5 import cc.sukazyo.cono.morny.system.utils.CommonEncrypt.MD5
import cc.sukazyo.cono.morny.util.ConvertByteHex.toHex import cc.sukazyo.cono.morny.system.utils.ConvertByteHex.toHex
java.lang.Long.parseLong(MD5(s"$identifier@$dayStamp").toHex.substring(0, 4), 16) / (0xffff toDouble) java.lang.Long.parseLong(MD5(s"$identifier@$dayStamp").toHex.substring(0, 4), 16) / (0xffff toDouble)
} }

View File

@ -1,10 +1,9 @@
package cc.sukazyo.cono.morny.morny_misc package cc.sukazyo.cono.morny.morny_misc
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ITelegramCommand} import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage
@ -27,7 +26,7 @@ class MornyOldJrrp (using coeur: MornyCoeur) extends ITelegramCommand {
case a if a > 30 => ";" case a if a > 30 => ";"
case _ => "..." case _ => "..."
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
SendMessage( SendMessage(
event.message.chat.id, event.message.chat.id,
// language=html // language=html

View File

@ -1,11 +1,10 @@
package cc.sukazyo.cono.morny.morny_misc package cc.sukazyo.cono.morny.morny_misc
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ISimpleCommand}
import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext} import cc.sukazyo.cono.morny.core.bot.api.messages.{ErrorMessage, MessagingContext}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ISimpleCommand}
import com.pengrad.telegrambot.model.{Message, Update} import com.pengrad.telegrambot.model.{Message, Update}
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.{SendMessage, SendSticker} import com.pengrad.telegrambot.request.{SendMessage, SendSticker}

View File

@ -2,11 +2,10 @@ package cc.sukazyo.cono.morny.nbnhhsh
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{ICommandAlias, ITelegramCommand}
import cc.sukazyo.cono.morny.data.TelegramStickers import cc.sukazyo.cono.morny.data.TelegramStickers
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.util.tgapi.InputCommand import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.command.{ICommandAlias, InputCommand, ITelegramCommand}
import com.pengrad.telegrambot.model.Update import com.pengrad.telegrambot.model.Update
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.{SendMessage, SendSticker} import com.pengrad.telegrambot.request.{SendMessage, SendSticker}

View File

@ -1,9 +1,9 @@
package cc.sukazyo.cono.morny.randomize_somthing package cc.sukazyo.cono.morny.randomize_somthing
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.randomize_somthing.OnQuestionMarkReply.isAllMessageMark import cc.sukazyo.cono.morny.randomize_somthing.OnQuestionMarkReply.isAllMessageMark
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -1,8 +1,8 @@
package cc.sukazyo.cono.morny.randomize_somthing package cc.sukazyo.cono.morny.randomize_somthing
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener} import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -2,18 +2,17 @@ package cc.sukazyo.cono.morny.reporter
import cc.sukazyo.cono.morny.core.{MornyCoeur, MornyConfig} import cc.sukazyo.cono.morny.core.{MornyCoeur, MornyConfig}
import cc.sukazyo.cono.morny.core.Log.logger import cc.sukazyo.cono.morny.core.Log.logger
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.data.MornyInformation.getVersionAllFullTagHTML import cc.sukazyo.cono.morny.data.MornyInformation.getVersionAllFullTagHTML
import cc.sukazyo.cono.morny.util.statistics.{NumericStatistics, UniqueCounter} import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener, EventRuntimeException}
import cc.sukazyo.cono.morny.util.tgapi.event.EventRuntimeException import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Update.{sourceChat, sourceUser}
import cc.sukazyo.cono.morny.util.EpochDateTime.DurationMillis import cc.sukazyo.cono.morny.system.utils.CommonEncrypt.hashId
import cc.sukazyo.cono.morny.system.utils.ConvertByteHex.toHex
import cc.sukazyo.cono.morny.system.utils.EpochDateTime.DurationMillis
import cc.sukazyo.cono.morny.util.schedule.CronTask import cc.sukazyo.cono.morny.util.schedule.CronTask
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Update.{sourceChat, sourceUser} import cc.sukazyo.cono.morny.util.statistics.{NumericStatistics, UniqueCounter}
import cc.sukazyo.cono.morny.util.CommonEncrypt.hashId
import cc.sukazyo.cono.morny.util.ConvertByteHex.toHex
import cc.sukazyo.cono.morny.util.UseThrowable.toLogString import cc.sukazyo.cono.morny.util.UseThrowable.toLogString
import com.cronutils.builder.CronBuilder import com.cronutils.builder.CronBuilder
import com.cronutils.model.Cron import com.cronutils.model.Cron
@ -183,8 +182,8 @@ class MornyReport (using coeur: MornyCoeur) {
| - <i>total</i>: <code>${f(value.total)}</code>""".stripMargin | - <i>total</i>: <code>${f(value.total)}</code>""".stripMargin
def eventStatisticsHTML: String = def eventStatisticsHTML: String =
import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.ChatTypeTag.*
import cc.sukazyo.cono.morny.util.UseMath.percentageOf as p import cc.sukazyo.cono.morny.util.UseMath.percentageOf as p
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.ChatTypeTag.*
val processed = runningTime.count val processed = runningTime.count
val canceled = eventCanceled val canceled = eventCanceled
val ignored = eventTotal - processed - canceled val ignored = eventTotal - processed - canceled

View File

@ -1,11 +1,11 @@
package cc.sukazyo.cono.morny.slash_action package cc.sukazyo.cono.morny.slash_action
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.{EventEnv, EventListener} import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramFormatter.*
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramFormatter.* import cc.sukazyo.cono.morny.system.telegram_api.formatting.TelegramParseEscape.escapeHtml as h
import cc.sukazyo.cono.morny.util.tgapi.formatting.TelegramParseEscape.escapeHtml as h import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.UniversalCommand import cc.sukazyo.cono.morny.system.telegram_api.event.{EventEnv, EventListener}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.utils.UniversalCommand
import com.pengrad.telegrambot.model.request.ParseMode import com.pengrad.telegrambot.model.request.ParseMode
import com.pengrad.telegrambot.request.SendMessage import com.pengrad.telegrambot.request.SendMessage
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

View File

@ -1,11 +1,11 @@
package cc.sukazyo.cono.morny.social_share.api package cc.sukazyo.cono.morny.social_share.api
import cc.sukazyo.cono.morny.core.MornyCoeur import cc.sukazyo.cono.morny.core.MornyCoeur
import cc.sukazyo.cono.morny.core.bot.api.InlineQueryUnit
import cc.sukazyo.cono.morny.social_share.api.SocialContent.{SocialMedia, SocialMediaType, SocialMediaWithUrl} import cc.sukazyo.cono.morny.social_share.api.SocialContent.{SocialMedia, SocialMediaType, SocialMediaWithUrl}
import cc.sukazyo.cono.morny.social_share.api.SocialContent.SocialMediaType.{Photo, Video} import cc.sukazyo.cono.morny.social_share.api.SocialContent.SocialMediaType.{Photo, Video}
import cc.sukazyo.cono.morny.util.tgapi.TelegramExtensions.Requests.unsafeExecute import cc.sukazyo.cono.morny.system.telegram_api.TelegramExtensions.Requests.unsafeExecute
import cc.sukazyo.cono.morny.util.tgapi.formatting.NamingUtils.inlineQueryId import cc.sukazyo.cono.morny.system.telegram_api.formatting.NamingUtils.inlineQueryId
import cc.sukazyo.cono.morny.system.telegram_api.inline_query.InlineQueryUnit
import com.pengrad.telegrambot.model.request.* import com.pengrad.telegrambot.model.request.*
import com.pengrad.telegrambot.request.{SendMediaGroup, SendMessage} import com.pengrad.telegrambot.request.{SendMediaGroup, SendMessage}
import com.pengrad.telegrambot.TelegramBot import com.pengrad.telegrambot.TelegramBot

Some files were not shown because too many files have changed in this diff Show More