File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
src/main/kotlin/by/jprof/telegram/bot/achievements/editor
src/main/kotlin/by/jprof/telegram/bot/runners/lambda/config Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ plugins {
2
+ kotlin(" jvm" )
3
+ }
4
+
5
+ dependencies {
6
+ api(project.projects.core)
7
+ api(libs.tgbotapi.core)
8
+ implementation(libs.log4j.api)
9
+
10
+ testImplementation(libs.junit.jupiter.api)
11
+ testImplementation(libs.junit.jupiter.params)
12
+ testImplementation(libs.mockk)
13
+ testRuntimeOnly(libs.junit.jupiter.engine)
14
+ testRuntimeOnly(libs.log4j.core)
15
+ }
Original file line number Diff line number Diff line change
1
+ package by.jprof.telegram.bot.achievements.editor
2
+
3
+ import by.jprof.telegram.bot.core.UpdateProcessor
4
+ import dev.inmo.tgbotapi.bot.RequestsExecutor
5
+ import dev.inmo.tgbotapi.types.message.abstracts.FromUserMessage
6
+ import dev.inmo.tgbotapi.types.update.abstracts.BaseEditMessageUpdate
7
+ import dev.inmo.tgbotapi.types.update.abstracts.Update
8
+ import org.apache.logging.log4j.LogManager
9
+
10
+ class EditorAchievementUpdateProcessor (
11
+ private val bot : RequestsExecutor ,
12
+ ) : UpdateProcessor {
13
+ companion object {
14
+ private val logger = LogManager .getLogger(EditorAchievementUpdateProcessor ::class .java)!!
15
+ }
16
+
17
+ override suspend fun process (update : Update ) {
18
+ @Suppress(" NAME_SHADOWING" )
19
+ val update = (update as ? BaseEditMessageUpdate ) ? : return
20
+ val message = (update.data as ? FromUserMessage ) ? : return
21
+
22
+ logger.debug(" {} edited a message" , message.user.id)
23
+ }
24
+ }
Original file line number Diff line number Diff line change @@ -13,4 +13,5 @@ dependencies {
13
13
implementation(project.projects.jep)
14
14
implementation(project.projects.youtube.dynamodb)
15
15
implementation(project.projects.kotlin.dynamodb)
16
+ implementation(project.projects.achievements.editor)
16
17
}
Original file line number Diff line number Diff line change 1
1
package by.jprof.telegram.bot.runners.lambda.config
2
2
3
+ import by.jprof.telegram.bot.achievements.editor.EditorAchievementUpdateProcessor
3
4
import by.jprof.telegram.bot.core.UpdateProcessingPipeline
4
5
import by.jprof.telegram.bot.core.UpdateProcessor
5
6
import by.jprof.telegram.bot.jep.JEPUpdateProcessor
@@ -37,4 +38,10 @@ val pipelineModule = module {
37
38
bot = get(),
38
39
)
39
40
}
41
+
42
+ single<UpdateProcessor >(named(" EditorAchievementUpdateProcessor" )) {
43
+ EditorAchievementUpdateProcessor (
44
+ bot = get(),
45
+ )
46
+ }
40
47
}
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ include(":core")
13
13
include(" :jep" )
14
14
include(" :youtube" )
15
15
include(" :youtube:dynamodb" )
16
+ include(" :achievements:editor" )
16
17
include(" :kotlin" )
17
18
include(" :kotlin:dynamodb" )
18
19
include(" :runners:lambda" )
You can’t perform that action at this time.
0 commit comments