Skip to content

Commit

Permalink
fix: poll translate
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed May 7, 2024
1 parent 09229ad commit 849a869
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun MessageObject.toRawString(): String {
for (answer in poll.answers) {

content += "\n- "
content += answer.text
content += answer.text.text

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import org.telegram.tgnet.TLRPC
fun postPollTrans(media: TLRPC.TL_messageMediaPoll, poll: TLRPC.TL_poll) {
poll.translatedQuestion = media.poll.translatedQuestion
poll.answers.forEach { answer ->
answer.translatedText = media.poll.answers.find { it.text == answer.text }!!.translatedText
val answerF = media.poll.answers.find { it.text.text == answer.text.text }
if (answerF != null) {
answer.translatedText = answerF.translatedText
}
}
}

0 comments on commit 849a869

Please sign in to comment.