File tree Expand file tree Collapse file tree 6 files changed +52
-1
lines changed
src/main/kotlin/by/jprof/telegram/bot/herald/processor
src/main/kotlin/by/jprof/telegram/bot/runners/lambda/config Expand file tree Collapse file tree 6 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 1+ = Herald / Processor
2+
3+ link:../../votes/voting-processor/src/main/kotlin/by/jprof/telegram/bot/votes/voting_processor/VotingProcessor.kt[`VotingProcessor`] implementation for this scheduled messages poster.
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(project.projects.votes)
8+ api(project.projects.votes.votingProcessor)
9+ implementation(libs.log4j.api)
10+ }
Original file line number Diff line number Diff line change 1+ package by.jprof.telegram.bot.herald.processor
2+
3+ import by.jprof.telegram.bot.core.UpdateProcessor
4+ import by.jprof.telegram.bot.votes.dao.VotesDAO
5+ import by.jprof.telegram.bot.votes.voting_processor.VotingProcessor
6+ import dev.inmo.tgbotapi.bot.RequestsExecutor
7+ import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate
8+ import dev.inmo.tgbotapi.types.update.abstracts.Update
9+ import org.apache.logging.log4j.LogManager
10+
11+ class HeraldVoteUpdateProcessor (
12+ votesDAO : VotesDAO ,
13+ bot : RequestsExecutor ,
14+ ) : VotingProcessor(
15+ " HERALD" ,
16+ votesDAO,
17+ { throw UnsupportedOperationException ("Votes should be constructed elsewhere!") },
18+ bot,
19+ ), UpdateProcessor {
20+ companion object {
21+ private val logger = LogManager .getLogger(HeraldVoteUpdateProcessor ::class .java)!!
22+ }
23+
24+ override suspend fun process (update : Update ) {
25+ when (update) {
26+ is CallbackQueryUpdate -> processCallbackQuery(update.data)
27+ }
28+ }
29+ }
Original file line number Diff line number Diff line change @@ -20,4 +20,5 @@ dependencies {
2020 implementation(project.projects.pins.dynamodb)
2121 implementation(project.projects.pins.sfn)
2222 implementation(project.projects.currencies)
23+ implementation(project.projects.herald.processor)
2324}
Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ package by.jprof.telegram.bot.runners.lambda.config
33import by.jprof.telegram.bot.core.UpdateProcessingPipeline
44import by.jprof.telegram.bot.core.UpdateProcessor
55import by.jprof.telegram.bot.currencies.CurrenciesUpdateProcessor
6- import by.jprof.telegram.bot.currencies.parser.MonetaryAmountParsingPipeline
76import by.jprof.telegram.bot.eval.EvalUpdateProcessor
7+ import by.jprof.telegram.bot.herald.processor.HeraldVoteUpdateProcessor
88import by.jprof.telegram.bot.jep.JEPUpdateProcessor
99import by.jprof.telegram.bot.jep.JsoupJEPSummary
1010import by.jprof.telegram.bot.kotlin.KotlinMentionsUpdateProcessor
@@ -123,4 +123,11 @@ val pipelineModule = module {
123123 bot = get(),
124124 )
125125 }
126+
127+ single<UpdateProcessor >(named(" HeraldVoteUpdateProcessor" )) {
128+ HeraldVoteUpdateProcessor (
129+ votesDAO = get(),
130+ bot = get(),
131+ )
132+ }
126133}
Original file line number Diff line number Diff line change @@ -31,3 +31,4 @@ include(":pins:sfn")
3131include(" :runners:lambda" )
3232include(" :currencies" )
3333include(" :herald" )
34+ include(" :herald:processor" )
You can’t perform that action at this time.
0 commit comments