From 98703409efad0cc87cfdb62c9c761fe01aef4718 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Sat, 21 Dec 2024 20:08:22 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=BC=E3=81=A1=E3=81=BC=E3=81=A1=20(=20#31?= =?UTF-8?q?=20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ nizika_ai | 1 + test.py | 13 +++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 nizika_ai diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6cd7edd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nizika_ai"] + path = nizika_ai + url = https://git.miteruzo.com/miteruzo/nizika_ai diff --git a/nizika_ai b/nizika_ai new file mode 160000 index 0000000..8e1d305 --- /dev/null +++ b/nizika_ai @@ -0,0 +1 @@ +Subproject commit 8e1d305b4ab1346ef2d2faf6eacda440674b06e8 diff --git a/test.py b/test.py index 1d009fc..28136a9 100644 --- a/test.py +++ b/test.py @@ -8,6 +8,7 @@ from enum import Enum, auto from typing import Callable, TypedDict import cv2 +import emoji import ephem # type: ignore import pygame import pygame.gfxdraw @@ -23,6 +24,7 @@ from pytchat.processors.default.processor import Chat # type: ignore from common_module import CommonModule from nizika_ai.models import Answer, AnsweredFlag, Query, User +from nizika_ai.consts import Platform pygame.init () @@ -55,10 +57,13 @@ def main ( pygame.quit () sys.exit () chat = broadcast.fetch_chat () - chat.message = emoji.emojize (chat.message) - message: str = chat.message - if where chat.author.channelId - # chat.author + if chat is not None: + chat.message = emoji.emojize (chat.message) + message: str = chat.message + user = (User.where ('platform', Platform.YOUTUBE.value) + .where ('code', chat.author.channelId) + .get ()) + # chat.author game.redraw ()