diff --git a/frontend/telegram_bot.go b/frontend/telegram_bot.go index a6bc32e..b677c45 100644 --- a/frontend/telegram_bot.go +++ b/frontend/telegram_bot.go @@ -93,7 +93,30 @@ func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) { } } else if telegramIsCommand(request.Message.Text, "whois") { - commandResult = whois(target) + tempResult := whois(target) + + // Filter out some long (and useless) keys + filteredPrefix := []string{ + "descr:", "remarks:", "ds-rdata:", "auth:", "country:", + "nserver:", "status:", "pgp-fingerprint:", "mp-import:", "mp-export:", + "members:", "key:", "inetnum:", "inet6num:", "%", + } + for _, s := range strings.Split(tempResult, "\n") { + if len(s) == 0 { + continue + } + shouldSkip := false + for _, filtered := range filteredPrefix { + if strings.HasPrefix(s, filtered) { + shouldSkip = true + } + } + if shouldSkip { + continue + } + + commandResult += s + "\n" + } } else if telegramIsCommand(request.Message.Text, "help") { commandResult = `