Files
bunny-bot/internal/moon/textMessage.go
eleksir 0c34b6e781 Global code ovehaul - remove CAS and other, add 15 minute greet check
- Remove CAS, as it no longer works for us
- Remove other checks
- Implement 15 minute greet timeout check
- Fix chat logos
- Ditch thirdparty logger, use stdlib log facility wrapper for logging
2026-10-20 12:20:16 +03:00

28 lines
690 B
Go

package moon
import (
"time"
"bunny-bot/internal/elog"
"github.com/NicoNex/echotron/v3"
)
// textMessage handles plain text messages. It does not moderate anything; it
// only records the message so the greeting sweeper can tell that a newcomer
// answered their greeting.
func textMessage(msg *echotron.Update) {
if msg.Message == nil || msg.Message.Text == "" {
return
}
// Remember the message so the greeting sweeper can find the answer to a
// greeting.
GreetAnswers.Set(time.Now().UnixMicro(), msg.Message, greetCacheTTL)
// And record it in the chat's own log, which outlives the cache.
elog.LogMessage(msg.Message)
}
/* vim: set ft=go noet ai ts=4 sw=4 sts=4: */