-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for admin /stats command
- Loading branch information
1 parent
9d0caa1
commit e90e461
Showing
8 changed files
with
69 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ru.ekuzmichev | ||
package bot | ||
|
||
object BotAdminCommands: | ||
val Stats = "/stats" |
2 changes: 1 addition & 1 deletion
2
...ala/bot/OzonPriceCheckerBotCommands.scala → src/main/scala/bot/BotGeneralCommands.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
package ru.ekuzmichev | ||
package consumer | ||
|
||
import config.AppConfig | ||
import store.ProductStore | ||
|
||
import org.telegram.telegrambots.meta.generics.TelegramClient | ||
import zio.{RLayer, ZLayer} | ||
import zio.{RLayer, ZIO, ZLayer} | ||
|
||
object CommandProcessorLayers: | ||
val ozonPriceChecker: RLayer[ProductStore & TelegramClient, CommandProcessor] = | ||
ZLayer.fromFunction(new OzonPriceCheckerCommandProcessor(_, _)) | ||
val ozonPriceChecker: RLayer[ProductStore & TelegramClient & AppConfig, CommandProcessor] = | ||
ZLayer.fromZIO(for | ||
productStore <- ZIO.service[ProductStore] | ||
telegramClient <- ZIO.service[TelegramClient] | ||
appConfig <- ZIO.service[AppConfig] | ||
yield new BotCommandProcessor(productStore, telegramClient, appConfig.admins.map(_.value))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters