eod commit

This commit is contained in:
2025-12-01 22:30:36 +01:00
parent 2372da942a
commit 8f7db6256b
9 changed files with 190 additions and 84 deletions

View File

@@ -1,10 +1,11 @@
package ws
import (
"context"
"encoding/json"
"log/slog"
"time"
"github.com/gorilla/websocket"
)
type LoggingModHandler struct {
@@ -23,7 +24,7 @@ func NewLoggingBotHandler(logger *slog.Logger) *LoggingBotHandler {
return &LoggingBotHandler{logger: logger}
}
func (h *LoggingModHandler) Handle(ctx context.Context, msg GatewayModMessageIn) error {
func (h *LoggingModHandler) Handle(conn *websocket.Conn, msg GatewayModMessageIn) error {
// For now, just log and pretend it's being forwarded
// TODO: Look up channel_id from database using server
// TODO: Forward to bot connection(s)
@@ -46,7 +47,7 @@ func (h *LoggingModHandler) Handle(ctx context.Context, msg GatewayModMessageIn)
return nil
}
func (h *LoggingBotHandler) Handle(ctx context.Context, msg GatewayBotMessageIn) error {
func (h *LoggingBotHandler) Handle(conn *websocket.Conn, msg GatewayBotMessageIn) error {
// For now, just log and pretend it's being forwarded
// TODO: Look up server_id from database using channel_id
// TODO: Forward to mod connection(s)