File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
quizoji/src/main/kotlin/by/jprof/telegram/bot/quizoji
votes/voting-processor/src/main/kotlin/by/jprof/telegram/bot/votes/voting_processor Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ package by.jprof.telegram.bot.quizoji
22
33import by.jprof.telegram.bot.core.UpdateProcessor
44import by.jprof.telegram.bot.votes.dao.VotesDAO
5+ import by.jprof.telegram.bot.votes.model.Votes
6+ import by.jprof.telegram.bot.votes.tgbotapi_extensions.toInlineKeyboardMarkup
57import by.jprof.telegram.bot.votes.voting_processor.VotingProcessor
68import dev.inmo.tgbotapi.bot.RequestsExecutor
79import dev.inmo.tgbotapi.types.update.CallbackQueryUpdate
@@ -21,4 +23,6 @@ class QuizojiVoteUpdateProcessor(
2123 is CallbackQueryUpdate -> processCallbackQuery(update.data)
2224 }
2325 }
26+
27+ override fun votesToInlineKeyboardMarkup (votes : Votes ) = votes.toInlineKeyboardMarkup(8 )
2428}
Original file line number Diff line number Diff line change @@ -41,13 +41,13 @@ abstract class VotingProcessor(
4141 is MessageDataCallbackQuery -> {
4242 bot.editMessageReplyMarkup(
4343 message = callbackQuery.message,
44- replyMarkup = updatedVotes.toInlineKeyboardMarkup( )
44+ replyMarkup = votesToInlineKeyboardMarkup(updatedVotes )
4545 )
4646 }
4747 is InlineMessageIdDataCallbackQuery -> {
4848 bot.editMessageReplyMarkup(
4949 inlineMessageId = callbackQuery.inlineMessageId,
50- replyMarkup = updatedVotes.toInlineKeyboardMarkup( )
50+ replyMarkup = votesToInlineKeyboardMarkup(updatedVotes )
5151 )
5252 }
5353 else -> {
@@ -57,5 +57,7 @@ abstract class VotingProcessor(
5757 }
5858 }
5959
60+ open fun votesToInlineKeyboardMarkup (votes : Votes ) = votes.toInlineKeyboardMarkup()
61+
6062 protected fun String.toVotesID () = " $prefix -$this "
6163}
You can’t perform that action at this time.
0 commit comments