|
|
@@ -31,7 +31,7 @@ class Main: |
|
|
|
italic = True) |
|
|
|
nizika_font = pygame.font.SysFont ('07nikumarufont', 50) |
|
|
|
|
|
|
|
messages: list[str] = [] |
|
|
|
chat_items: list = [] |
|
|
|
|
|
|
|
while (True): |
|
|
|
screen.fill ((0, 255, 0)) |
|
|
@@ -49,7 +49,7 @@ class Main: |
|
|
|
if live_chat.is_alive (): |
|
|
|
screen.blit ( |
|
|
|
system_font.render ( |
|
|
|
f'messages == {messages}', |
|
|
|
f'chat_items == {chat_items}', |
|
|
|
True, (0, 0, 0)), |
|
|
|
(i % 2, 64 + i // 2 * 2)) |
|
|
|
|
|
|
@@ -60,7 +60,7 @@ class Main: |
|
|
|
chat_item = random.choice (chat_items) |
|
|
|
chat_item.author = chat_item.author.__dict__ |
|
|
|
message: str = chat_item.message |
|
|
|
answer: str = Talk.main (message, chat_item.author['name']) |
|
|
|
answer: str = Talk.main (message, chat_item.author['name']).replace ('\n', ' ') |
|
|
|
|
|
|
|
with open ('log.txt', 'a') as f: |
|
|
|
f.write (f'{datetime.now ()}\t{json.dumps (chat_item.__dict__)}\t{answer}\n') |
|
|
@@ -73,17 +73,35 @@ class Main: |
|
|
|
<= 21) |
|
|
|
else (CommonModule.mid_by_full ( |
|
|
|
message, 0, 19.5) |
|
|
|
+ '...')), True, (0, 0, 0)), |
|
|
|
+ '...')), |
|
|
|
True, |
|
|
|
(0, 0, 0)), |
|
|
|
(120, 70)) |
|
|
|
screen.blit ( |
|
|
|
nizika_font.render (answer, True, (192, 0, 0)), |
|
|
|
nizika_font.render ( |
|
|
|
(answer |
|
|
|
if CommonModule.len_by_full (answer) <= 26 |
|
|
|
else CommonModule.mid_by_full (answer, 0, 26)), |
|
|
|
True, |
|
|
|
(192, 0, 0)), |
|
|
|
(100, 150)) |
|
|
|
if CommonModule.len_by_full (answer) > 26: |
|
|
|
screen.blit ( |
|
|
|
nizika_font.render ( |
|
|
|
(CommonModule.mid_by_full (answer, 26, 26) |
|
|
|
if CommonModule.len_by_full (answer) <= 52 |
|
|
|
else (CommonModule.mid_by_full ( |
|
|
|
answer, 26, 24.5) |
|
|
|
+ '...')), |
|
|
|
True, |
|
|
|
(192, 0, 0)), |
|
|
|
(100, 200)) |
|
|
|
|
|
|
|
pygame.display.update () |
|
|
|
|
|
|
|
noon.play () |
|
|
|
|
|
|
|
time.sleep (2) |
|
|
|
time.sleep (1.5) |
|
|
|
|
|
|
|
wav: bytearray | None = Aques.main (answer) |
|
|
|
if wav is not None: |
|
|
|