package main import ( "github.com/rs/zerolog/log" "time" "watn3y/bloaterbotv3/botIO" "watn3y/bloaterbotv3/commands" "watn3y/bloaterbotv3/commands/notify" "watn3y/bloaterbotv3/text" ) func bot() { updates, bot := botIO.Authenticate() go notify.NotifyHandler(bot) now := time.Now().UTC() for update := range updates { if update.Message == nil || update.Message.Time().UTC().Unix() < now.UTC().Unix() { continue } log.Info().Int64("user", update.Message.From.ID).Int64("chat", update.Message.Chat.ID).Str("msg", update.Message.Text).Msg("Recieved update:") log.Debug().Interface("update", update).Msg("") if update.Message.IsCommand() { commands.Commands(update, bot) } else { text.Matcher(update, bot) } } }