このコミットが含まれているのは:
+16
-6
@@ -9,7 +9,7 @@ from datetime import datetime
|
||||
from typing import TypedDict
|
||||
|
||||
from nizika_ai.config import DB
|
||||
from nizika_ai.consts import AnswerType, Character, Platform
|
||||
from nizika_ai.consts import Character, Platform, QueryType
|
||||
from nizika_ai.models import Answer, AnsweredFlag, Query
|
||||
from nizika_ai.talk import Talk
|
||||
|
||||
@@ -83,7 +83,6 @@ def add_answer (
|
||||
answer.character = character.value
|
||||
answer.content = Talk.main (message, user_name, histories,
|
||||
goatoh_mode = character == Character.GOATOH)
|
||||
answer.answer_type = query.query_type
|
||||
answer.sent_at = datetime.now ()
|
||||
answer.save ()
|
||||
add_answered_flags (answer)
|
||||
@@ -101,15 +100,26 @@ def add_answered_flags (
|
||||
返答モデル
|
||||
"""
|
||||
|
||||
answer_type: AnswerType
|
||||
answer_type: QueryType
|
||||
try:
|
||||
answer_type = AnswerType (answer.answer_type)
|
||||
answer_type = QueryType (answer.query.query_type)
|
||||
except (TypeError, ValueError):
|
||||
return
|
||||
|
||||
if answer_type in (AnswerType.YOUTUBE_REPLY,):
|
||||
if answer_type in (QueryType.YOUTUBE_COMMENT,
|
||||
QueryType.YOUTUBE_COMMENT,
|
||||
QueryType.KIRIBAN,
|
||||
QueryType.NICO_REPORT,
|
||||
QueryType.SNACK_TIME,
|
||||
QueryType.HOT_SPRING):
|
||||
add_answered_flag (answer, Platform.YOUTUBE)
|
||||
if answer_type in (AnswerType.BLUESKY_REPLY,):
|
||||
|
||||
if answer_type in (QueryType.BLUESKY_COMMENT,
|
||||
QueryType.BLUESKY_SYSTEM,
|
||||
QueryType.KIRIBAN,
|
||||
QueryType.NICO_REPORT,
|
||||
QueryType.SNACK_TIME,
|
||||
QueryType.HOT_SPRING):
|
||||
add_answered_flag (answer, Platform.BLUESKY)
|
||||
|
||||
|
||||
|
||||
新しい課題から参照
ユーザをブロックする