aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/tourian/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/tourian/main.go b/cmd/tourian/main.go
index cd09241..debc8b0 100644
--- a/cmd/tourian/main.go
+++ b/cmd/tourian/main.go
@@ -8,6 +8,7 @@ import (
"flag"
"log"
"log/slog"
+ "math/rand"
"net/http"
"github.com/a-h/templ"
@@ -235,7 +236,10 @@ func (s *Server) WebsocketHandler(w http.ResponseWriter, r *http.Request) {
buf.Reset()
- if err := s.ExecTemplate(r.Context(), conn, chatBubble(avatarURL, mid, "Mimi", olresp.Message.Content)); err != nil {
+ moods := []string{"coffee", "happy", "think", "yawn"}
+ mood := moods[rand.Intn(len(moods))]
+
+ if err := s.ExecTemplate(r.Context(), conn, chatBubble(mimiAvatar(mood), mid, "Mimi", mdToHTML([]byte(olresp.Message.Content)))); err != nil {
slog.Error("failed to execute template", "err", err)
break
}