diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/formatter/telegram.go | 18 | ||||
| -rw-r--r-- | internal/models/telegram.go | 7 |
2 files changed, 22 insertions, 3 deletions
diff --git a/internal/formatter/telegram.go b/internal/formatter/telegram.go index 7491c66..b1b7b7c 100644 --- a/internal/formatter/telegram.go +++ b/internal/formatter/telegram.go @@ -2,6 +2,7 @@ package formatter import ( "fmt" + "strings" "git.db.org.ai/dborg/internal/models" "git.db.org.ai/dborg/internal/utils" ) @@ -11,16 +12,31 @@ func FormatTelegramResults(response *models.TelegramPhoneResponse, asJSON bool) return utils.PrintJSON(response) } - PrintSection(fmt.Sprintf("📱 Telegram Phone Lookup")) + PrintSection("📱 Telegram Phone Lookup") fmt.Printf("%s: %s\n", Cyan("Identifier"), response.Identifier) + if response.TelegramID != "" { + fmt.Printf("%s: %s\n", Cyan("Telegram ID"), response.TelegramID) + } + if response.PhoneNumber != "" { fmt.Printf("%s: %s\n", Cyan("Phone Number"), Green(response.PhoneNumber)) } else { fmt.Printf("%s: %s\n", Cyan("Phone Number"), Red("Not found")) } + if len(response.Contacts) > 0 { + fmt.Printf("%s: %s\n", Cyan("Contacts"), strings.Join(response.Contacts, ", ")) + } + + if len(response.Groups) > 0 { + fmt.Printf("%s:\n", Cyan("Groups")) + for _, g := range response.Groups { + fmt.Printf(" • %s\n", g) + } + } + fmt.Println() PrintDivider() fmt.Printf("%s: ", Cyan("Credits Remaining")) diff --git a/internal/models/telegram.go b/internal/models/telegram.go index 05900cb..8afbdcd 100644 --- a/internal/models/telegram.go +++ b/internal/models/telegram.go @@ -1,8 +1,11 @@ package models type TelegramPhoneResponse struct { - Identifier string `json:"identifier"` - PhoneNumber string `json:"phone_number"` + Identifier string `json:"identifier"` + TelegramID string `json:"telegram_id,omitempty"` + PhoneNumber string `json:"phone_number,omitempty"` + Contacts []string `json:"contacts,omitempty"` + Groups []string `json:"groups,omitempty"` Credits struct { Remaining int `json:"remaining"` Unlimited bool `json:"unlimited"` |
