summaryrefslogtreecommitdiffstats
path: root/internal/formatter/telegram.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/formatter/telegram.go')
-rw-r--r--internal/formatter/telegram.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/internal/formatter/telegram.go b/internal/formatter/telegram.go
new file mode 100644
index 0000000..7491c66
--- /dev/null
+++ b/internal/formatter/telegram.go
@@ -0,0 +1,34 @@
+package formatter
+
+import (
+ "fmt"
+ "git.db.org.ai/dborg/internal/models"
+ "git.db.org.ai/dborg/internal/utils"
+)
+
+func FormatTelegramResults(response *models.TelegramPhoneResponse, asJSON bool) error {
+ if asJSON {
+ return utils.PrintJSON(response)
+ }
+
+ PrintSection(fmt.Sprintf("📱 Telegram Phone Lookup"))
+
+ fmt.Printf("%s: %s\n", Cyan("Identifier"), response.Identifier)
+
+ 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"))
+ }
+
+ fmt.Println()
+ PrintDivider()
+ fmt.Printf("%s: ", Cyan("Credits Remaining"))
+ if response.Credits.Unlimited {
+ fmt.Printf("%s\n", Green("Unlimited"))
+ } else {
+ fmt.Printf("%s\n", FormatCredits(int64(response.Credits.Remaining)))
+ }
+
+ return nil
+}