diff --git a/queries_to_answers.py b/queries_to_answers.py index f1e5fd7..68c8670 100644 --- a/queries_to_answers.py +++ b/queries_to_answers.py @@ -4,10 +4,10 @@ import random from datetime import datetime from typing import TypedDict -from .config import DB -from .consts import AnswerType, Character, Platform -from .models import Answer, AnsweredFlag, Query, User -from .talk import Talk +from nizika_ai.config import DB +from nizika_ai.consts import AnswerType, Character, Platform +from nizika_ai.models import Answer, AnsweredFlag, Query, User +from nizika_ai.talk import Talk def main ( @@ -60,10 +60,14 @@ def add_answer ( def add_answered_flags ( answer: Answer, ) -> None: - print (answer.answer_type) - if answer.answer_type in [AnswerType.YOUTUBE_REPLY]: + answer_type: AnswerType + try: + answer_type = AnswerType (answer.answer_type) + except Exception: + return + if answer_type in [AnswerType.YOUTUBE_REPLY]: add_answered_flag (answer, Platform.YOUTUBE) - if answer.answer_type in [AnswerType.BLUESKY_REPLY]: + if answer_type in [AnswerType.BLUESKY_REPLY]: add_answered_flag (answer, Platform.BLUESKY)