From eba85c6b97dbbab8b9b437e557a3dd5e6de41984 Mon Sep 17 00:00:00 2001 From: Castor Regex Date: Sun, 31 Aug 2025 22:34:53 -0500 Subject: [PATCH] feat: dump last chat entry --- dumpchat.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dumpchat.go b/dumpchat.go index e40a6f7..dbaa3ee 100644 --- a/dumpchat.go +++ b/dumpchat.go @@ -5,8 +5,14 @@ import ( "go.wit.com/log" ) +func dumpEntry(entry *chatpb.ChatEntry) { + log.Printf(entry.FormatTEXT()) +} + func dumpchat(chat *chatpb.Chat) { - for _, entry := range chat.GetEntries() { - log.Printf("Entry: %s\n", entry.GetUuid()) + entries := chat.GetEntries() + if len(entries) > 0 { + lastEntry := entries[len(entries)-1] + dumpEntry(lastEntry) } }