This commit is contained in:
InsanusMokrassar committed 2022-09-04 15:48:45 +06:00
1 parent e8637a2de6
commit 96d3e52c5f
2 files changed
+10 -5

No files matched your search

+4 -3
View File
@@ -31,7 +31,8 @@ object Plugin : Plugin {
@Serializable
data class Config(
val chats: ChatConfig,
val autoRemoveMessages: Boolean = true
val autoRemoveMessages: Boolean = true,
val deleteAfterPublishing: Boolean = true
)
override fun Module.setupDI(database: Database, params: JsonObject) {
val configJson = params["posts"] ?: this@Plugin.let {
@@ -48,8 +49,8 @@ object Plugin : Plugin {
WritePostsRepo::class,
)
single {
val config = get<ChatConfig>()
PostPublisher(get(), get(), config.cacheChatId, config.targetChatId)
val config = get<Config>()
PostPublisher(get(), get(), config.chats.cacheChatId, config.chats.targetChatId, config.deleteAfterPublishing)
}
}