Browse Source

ゴートうと対話モード

othello
みてるぞ 8 months ago
parent
commit
9330b68e1f
4 changed files with 40 additions and 16 deletions
  1. +1
    -1
      aques.py
  2. +29
    -14
      main.py
  3. +8
    -0
      mode.py
  4. +2
    -1
      talk.py

+ 1
- 1
aques.py View File

@@ -1,5 +1,5 @@
from ctypes import *
import subprocess import subprocess
from ctypes import *




class Aques: class Aques:


+ 29
- 14
main.py View File

@@ -1,23 +1,38 @@
import pygame
from pygame.locals import *
import sys
import pytchat
import time
import json
import random import random
from talk import Talk
import subprocess import subprocess
from aques import Aques
import sys
import time
from datetime import datetime

import emoji
import pygame
import pytchat
from playsound import playsound from playsound import playsound
from pygame.locals import *

from aques import Aques
from common_module import CommonModule from common_module import CommonModule
from mode import Mode
from talk import Talk
from youtube import * from youtube import *
from datetime import datetime
import json
import emoji




class Main: class Main:
@classmethod @classmethod
def main (cls, goatoh_mode: bool = False) -> None:
def main (cls, argv: list, argc: int) -> None:
mode = Mode.NIZIKA
if argc > 0:
match argv[0]:
case '-g':
mode = Mode.GOATOH

case '-w':
mode = Mode.DOUBLE

goatoh_mode = mode == Mode.GOATOH
double_mode = mode == Mode.DOUBLE

print (goatoh_mode) print (goatoh_mode)


pygame.init () pygame.init ()
@@ -34,8 +49,7 @@ class Main:
live_chat = pytchat.create (video_id = YOUTUBE_ID) live_chat = pytchat.create (video_id = YOUTUBE_ID)


system_font = pygame.font.SysFont ('notosanscjkjp', 24, bold = True) system_font = pygame.font.SysFont ('notosanscjkjp', 24, bold = True)
user_font = pygame.font.SysFont ('notosanscjkjp', 32,
italic = True)
user_font = pygame.font.SysFont ('notosanscjkjp', 32, italic = True)
nizika_font = pygame.font.SysFont ('07nikumarufont', 50) nizika_font = pygame.font.SysFont ('07nikumarufont', 50)


chat_items: list = [] chat_items: list = []
@@ -133,5 +147,6 @@ class Main:




if __name__ == '__main__': if __name__ == '__main__':
Main.main ((len (sys.argv) > 1) and (sys.argv[1] == '-g'))
# Main.main ((len (sys.argv) > 1) and (sys.argv[1] == '-g'))
Main.main (sys.argv, len (sys.argv))



+ 8
- 0
mode.py View File

@@ -0,0 +1,8 @@
from enum import Enum, auto


class Mode (Enum):
NIZIKA = auto ()
GOATOH = auto ()
DOUBLE = auto ()


+ 2
- 1
talk.py View File

@@ -1,7 +1,8 @@
import sys import sys
from datetime import datetime

import openai import openai
from openai.types import * from openai.types import *
from datetime import datetime


from connection import * from connection import *




Loading…
Cancel
Save