みてるぞ 3 weeks ago
parent
commit
58fb37296a
1 changed files with 11 additions and 7 deletions
  1. +11
    -7
      queries_to_answers.py

+ 11
- 7
queries_to_answers.py View File

@@ -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)




Loading…
Cancel
Save