Skip to content

Commit

Permalink
read bot token from .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
psisoyev committed Oct 25, 2019
1 parent 4c2dcd1 commit a576f56
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BOT_TOKEN=YOUR_BOT_TOKEN_HERE
4 changes: 2 additions & 2 deletions backend/src/main/scala/io/pager/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import zio.{ ZEnv, _ }

object Main extends zio.App {
override def run(args: List[String]): ZIO[ZEnv, Nothing, Int] = {
val token = "XXX"
val token = sys.env("BOT_TOKEN")

val result: ZIO[ZEnv, Throwable, Unit] = for {
_ <- putStrLn("Starting bot")

program = ZIO.environment[AppEnv].flatMap(_.telegramClient.start(token))
program = ZIO.environment[AppEnv].flatMap(_.telegramClient.start(token))

_ <- program.provideSome[ZEnv] { base =>
new Clock with Console with TelegramClient.Canoe with GitHubRepositoryValidator with ConsoleLogger {
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.2.0")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.8")
//addSbtPlugin("au.com.onegeek" % "sbt-dotenv" % "2.1.146")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.8")
addSbtPlugin("au.com.onegeek" % "sbt-dotenv" % "2.1.146")
//addSbtPlugin("org.duhemm" % "sbt-errors-summary" % "0.6.3")

0 comments on commit a576f56

Please sign in to comment.