Compare commits
1 Commits
afe113c2db
...
b6921f09d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6921f09d1 |
11
build.sbt
11
build.sbt
@@ -3,14 +3,15 @@ import Dependencies._
|
|||||||
lazy val commonSettings = Seq(
|
lazy val commonSettings = Seq(
|
||||||
organization := "com.example",
|
organization := "com.example",
|
||||||
scalaVersion := "2.12.8",
|
scalaVersion := "2.12.8",
|
||||||
version := "0.1.0-SNAPSHOT",
|
version := "1.0.0",
|
||||||
mainClass := Some("eu.xeppaka.bot.Main")
|
mainClass := Some("eu.xeppaka.bot.Main")
|
||||||
)
|
)
|
||||||
|
|
||||||
inThisBuild(commonSettings)
|
inThisBuild(commonSettings)
|
||||||
|
|
||||||
lazy val `telegram-bot` = (project in file("telegram-bot"))
|
lazy val `telegram-bot-delivery` = (project in file("."))
|
||||||
.settings(
|
.settings(
|
||||||
|
name := "telegram-bot-delivery",
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
scalaTest % Test,
|
scalaTest % Test,
|
||||||
akka,
|
akka,
|
||||||
@@ -23,6 +24,10 @@ lazy val `telegram-bot` = (project in file("telegram-bot"))
|
|||||||
circleGeneric,
|
circleGeneric,
|
||||||
circleParser,
|
circleParser,
|
||||||
circeAkkaHttp
|
circeAkkaHttp
|
||||||
)
|
),
|
||||||
|
Docker / defaultLinuxInstallLocation := "/opt/telegram-bot-delivery",
|
||||||
|
Docker / dockerExposedPorts := Seq(88, 8443),
|
||||||
|
Docker / dockerRepository := Some("registry.xeppaka.eu:443")
|
||||||
)
|
)
|
||||||
|
.enablePlugins(JavaServerAppPackaging)
|
||||||
.enablePlugins(DockerPlugin)
|
.enablePlugins(DockerPlugin)
|
||||||
|
|||||||
@@ -1,16 +1,26 @@
|
|||||||
import sbt._
|
import sbt._
|
||||||
|
|
||||||
|
import Dependencies.Versions._
|
||||||
|
|
||||||
object Dependencies {
|
object Dependencies {
|
||||||
lazy val akka = "com.typesafe.akka" %% "akka-actor" % "2.5.19"
|
object Versions {
|
||||||
lazy val akkaTyped = "com.typesafe.akka" %% "akka-actor-typed" % "2.5.19"
|
val akkaVersion = "2.5.22"
|
||||||
lazy val akkaStream = "com.typesafe.akka" %% "akka-stream" % "2.5.19"
|
val akkaHttpVersion = "10.1.8"
|
||||||
lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % "10.1.5"
|
val levelDbJniVersion = "1.8"
|
||||||
lazy val akkaPersistence = "com.typesafe.akka" %% "akka-persistence-typed" % "2.5.19"
|
val circeVersion = "0.11.1"
|
||||||
lazy val levelDbJni = "org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8"
|
val akkaHttpCirceVersion = "1.23.0"
|
||||||
//lazy val vkapi = "com.vk.api" % "sdk" % "0.5.12"
|
val scalaTestVersion = "3.0.5"
|
||||||
lazy val circleCore = "io.circe" %% "circe-core" % "0.10.0"
|
}
|
||||||
lazy val circleGeneric = "io.circe" %% "circe-generic" % "0.10.0"
|
|
||||||
lazy val circleParser = "io.circe" %% "circe-parser" % "0.10.0"
|
lazy val akka = "com.typesafe.akka" %% "akka-actor" % akkaVersion
|
||||||
lazy val circeAkkaHttp = "de.heikoseeberger" %% "akka-http-circe" % "1.22.0"
|
lazy val akkaTyped = "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion
|
||||||
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.5"
|
lazy val akkaStream = "com.typesafe.akka" %% "akka-stream" % akkaVersion
|
||||||
|
lazy val akkaHttp = "com.typesafe.akka" %% "akka-http" % akkaHttpVersion
|
||||||
|
lazy val akkaPersistence = "com.typesafe.akka" %% "akka-persistence-typed" % akkaVersion
|
||||||
|
lazy val levelDbJni = "org.fusesource.leveldbjni" % "leveldbjni-all" % levelDbJniVersion
|
||||||
|
lazy val circleCore = "io.circe" %% "circe-core" % circeVersion
|
||||||
|
lazy val circleGeneric = "io.circe" %% "circe-generic" % circeVersion
|
||||||
|
lazy val circleParser = "io.circe" %% "circe-parser" % circeVersion
|
||||||
|
lazy val circeAkkaHttp = "de.heikoseeberger" %% "akka-http-circe" % akkaHttpCirceVersion
|
||||||
|
lazy val scalaTest = "org.scalatest" %% "scalatest" % scalaTestVersion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
sbt.version=1.2.7
|
sbt.version=1.2.8
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import akka.actor.typed.scaladsl.Behaviors
|
|||||||
import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy}
|
import akka.actor.typed.{ActorRef, Behavior, SupervisorStrategy}
|
||||||
import akka.persistence.typed.PersistenceId
|
import akka.persistence.typed.PersistenceId
|
||||||
import akka.persistence.typed.scaladsl.EventSourcedBehavior.{CommandHandler, EventHandler}
|
import akka.persistence.typed.scaladsl.EventSourcedBehavior.{CommandHandler, EventHandler}
|
||||||
import akka.persistence.typed.scaladsl.{Effect, EventSourcedBehavior}
|
import akka.persistence.typed.scaladsl.{Effect, EffectBuilder, EventSourcedBehavior}
|
||||||
import akka.util.Timeout
|
import akka.util.Timeout
|
||||||
import eu.xeppaka.bot.CheckDeliveryDialog.{ProcessMessageFailure, ProcessMessageSuccess}
|
import eu.xeppaka.bot.CheckDeliveryDialog.{ProcessMessageFailure, ProcessMessageSuccess}
|
||||||
import eu.xeppaka.bot.TelegramEntities.Update
|
import eu.xeppaka.bot.TelegramEntities.Update
|
||||||
@@ -36,7 +36,7 @@ object DialogManager {
|
|||||||
if (update.message.isDefined) {
|
if (update.message.isDefined) {
|
||||||
val chatId = update.message.get.chat.id
|
val chatId = update.message.get.chat.id
|
||||||
|
|
||||||
val effect: Effect[Event, State] = if (state.dialogs.contains(chatId)) {
|
val effect: EffectBuilder[Event, State] = if (state.dialogs.contains(chatId)) {
|
||||||
Effect.none
|
Effect.none
|
||||||
} else {
|
} else {
|
||||||
Effect.persist(DialogAdded(chatId))
|
Effect.persist(DialogAdded(chatId))
|
||||||
Reference in New Issue
Block a user