diff options
| author | s <[email protected]> | 2025-11-25 09:38:31 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-25 09:38:31 -0500 |
| commit | 8472267b60b204cea5fbdeaf8fe06443822d1bfb (patch) | |
| tree | eba71104733067072ded109bf96904cd825c2f7f /internal/formatter/crypto.go | |
| parent | bc31d9cc8f93a5efef958872f48f3f4370ed5e29 (diff) | |
| download | dborg-8472267b60b204cea5fbdeaf8fe06443822d1bfb.tar.gz dborg-8472267b60b204cea5fbdeaf8fe06443822d1bfb.zip | |
feat: add crypto analysis, email verification, and telegram lookup commands
Diffstat (limited to 'internal/formatter/crypto.go')
| -rw-r--r-- | internal/formatter/crypto.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/internal/formatter/crypto.go b/internal/formatter/crypto.go new file mode 100644 index 0000000..70ef29b --- /dev/null +++ b/internal/formatter/crypto.go @@ -0,0 +1,39 @@ +package formatter + +import ( + "fmt" + "git.db.org.ai/dborg/internal/models" + "git.db.org.ai/dborg/internal/utils" + "strings" +) + +func FormatCryptoResults(response *models.CryptoResponse, asJSON bool) error { + if asJSON { + return utils.PrintJSON(response) + } + + PrintSection(fmt.Sprintf("📊 Crypto Analysis Results")) + + if response.Query != "" { + fmt.Printf("%s: %s\n\n", Cyan("Query"), response.Query) + } + + if response.Response != "" { + fmt.Println(response.Response) + 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))) + } + + if response.Message != "" && !strings.Contains(strings.ToLower(response.Message), "success") { + fmt.Printf("\n%s: %s\n", Yellow("Message"), response.Message) + } + + return nil +} |
