diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/MessageTrans.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/MessageTrans.kt index 9e855cf0a3..f97b3933a7 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/MessageTrans.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/MessageTrans.kt @@ -31,7 +31,7 @@ fun MessageObject.toRawString(): String { for (answer in poll.answers) { content += "\n- " - content += answer.text + content += answer.text.text } diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/PollTransUpdates.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/PollTransUpdates.kt index 246143fc42..3297148bbb 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/PollTransUpdates.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/parts/PollTransUpdates.kt @@ -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 + } } } \ No newline at end of file