Browse Source

#3 DB å®忘れ

main
みてるぞ 1 month ago
parent
commit
eccf46fa68
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      queries_to_answers.py

+ 3
- 0
queries_to_answers.py View File

@@ -6,12 +6,15 @@ from enum import Enum

from eloquent import DatabaseManager, Model

from config import CONFIG
from models import Answer, Query, User
from talk import Talk


def main (
) -> None:
db = DatabaseManager (CONFIG)
Model.set_connection_resolver (db)
queries: list[Query] = Query.where ('answered', False).get ()
query: Query = random.choice (queries)
message: str | list[dict[str, str | dict[str, str]]]


Loading…
Cancel
Save